/**
 * WC Elementor Activator — Frontend Widget Styles
 * Applies to all 12 custom widgets on the frontend.
 */

/* ── Common placeholder (editor only) ──────────────────────────────────────── */
.wcea-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    padding: 16px 20px;
    background: #f8f9fc;
    border: 2px dashed #c0c7d6;
    border-radius: 8px;
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
    text-align: center;
    line-height: 1.5;
}

/* ── Product Featured Image ─────────────────────────────────────────────────── */
.wcea-product-image-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
}
.wcea-product-image-wrap img {
    display: block;
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.wcea-sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: #e53e3e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Product Gallery ─────────────────────────────────────────────────────────── */
.wcea-gallery-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.wcea-gallery-wrap.wcea-thumb-left,
.wcea-gallery-wrap.wcea-thumb-right {
    flex-direction: row;
    align-items: flex-start;
}
.wcea-gallery-wrap.wcea-thumb-right {
    flex-direction: row-reverse;
}
.wcea-gallery-main {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
}
.wcea-gallery-main img {
    display: block;
    width: 100%;
    height: auto;
    cursor: zoom-in;
    transition: transform 0.4s ease;
}
.wcea-gallery-wrap.wcea-zoom .wcea-gallery-main:hover img {
    transform: scale(1.04);
}
.wcea-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(var(--wcea-cols, 4), 1fr);
    gap: 8px;
}
.wcea-thumb-left .wcea-gallery-thumbs,
.wcea-thumb-right .wcea-gallery-thumbs {
    grid-template-columns: 1fr;
    width: 80px;
    flex-shrink: 0;
}
.wcea-gallery-thumb {
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}
.wcea-gallery-thumb:hover,
.wcea-gallery-thumb.wcea-active {
    border-color: #7c3aed;
}
.wcea-gallery-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

/* ── Product Title ──────────────────────────────────────────────────────────── */
.wcea-product-title {
    margin: 0 0 0.5em;
    line-height: 1.3;
}

/* ── Product Price ──────────────────────────────────────────────────────────── */
.wcea-product-price .price {
    font-size: 1.5em;
    font-weight: 700;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.wcea-product-price .price del {
    opacity: 0.55;
    font-size: 0.8em;
    font-weight: 400;
    text-decoration: line-through;
}
.wcea-product-price .price ins {
    text-decoration: none;
    color: #e53e3e;
}

/* ── Product Rating ─────────────────────────────────────────────────────────── */
.wcea-product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.wcea-stars {
    display: flex;
    gap: 2px;
    line-height: 1;
}
.wcea-star {
    font-size: 18px;
    line-height: 1;
    color: #f0ad4e;
    transition: transform 0.15s ease;
}
.wcea-star.empty {
    color: #ddd;
}
.wcea-review-count {
    font-size: 13px;
    color: #888;
}

/* ── Add to Cart ────────────────────────────────────────────────────────────── */
.wcea-add-to-cart .quantity {
    margin-right: 8px;
}
.wcea-add-to-cart.wcea-full-width .button,
.wcea-add-to-cart.wcea-full-width form.cart {
    width: 100%;
}
.wcea-add-to-cart.wcea-full-width form.cart {
    display: flex;
    gap: 8px;
    align-items: center;
}
.wcea-add-to-cart.wcea-full-width .single_add_to_cart_button {
    flex: 1;
}
.wcea-add-to-cart .button {
    transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}
.wcea-add-to-cart .button:hover {
    transform: translateY(-1px);
}
.wcea-add-to-cart .button:active {
    transform: translateY(0);
}

/* ── Short Description ──────────────────────────────────────────────────────── */
.wcea-short-description {
    line-height: 1.7;
}
.wcea-short-description p:last-child {
    margin-bottom: 0;
}

/* ── Stock Status ───────────────────────────────────────────────────────────── */
.wcea-stock-wrap {
    margin: 4px 0;
}
.wcea-stock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    letter-spacing: 0.3px;
}
.wcea-stock.instock {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}
.wcea-stock.outofstock {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}
.wcea-stock.onbackorder {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

/* ── Product Meta ───────────────────────────────────────────────────────────── */
.wcea-product-meta {
    font-size: 14px;
    line-height: 1.6;
}
.wcea-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.wcea-meta-row .wcea-label {
    font-weight: 700;
    white-space: nowrap;
    min-width: 80px;
    color: #555;
}
.wcea-meta-row .wcea-value {
    color: #444;
}
.wcea-meta-row a {
    color: #7c3aed;
    text-decoration: none;
    transition: color 0.2s;
}
.wcea-meta-row a:hover {
    color: #5b21b6;
    text-decoration: underline;
}

/* ── Data Tabs ──────────────────────────────────────────────────────────────── */
.wcea-data-tabs .wc-tabs {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid #e5e7eb;
}
.wcea-data-tabs .wc-tabs li a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    color: #6b7280;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.wcea-data-tabs .wc-tabs li.active a {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}
/* Pills style */
.wcea-tabs-style-pills .wc-tabs {
    border-bottom: none;
    gap: 8px;
    margin-bottom: 16px;
}
.wcea-tabs-style-pills .wc-tabs li {
    border: none;
}
.wcea-tabs-style-pills .wc-tabs li a {
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 6px 16px;
    margin-bottom: 0;
}
.wcea-tabs-style-pills .wc-tabs li.active a {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}
/* Boxed style */
.wcea-tabs-style-boxed .wc-tabs {
    border-bottom: none;
    margin-bottom: 0;
}
.wcea-tabs-style-boxed .wc-tabs li a {
    border: 2px solid #e5e7eb;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}
.wcea-tabs-style-boxed .wc-tabs li.active a {
    background: #fff;
    border-color: #7c3aed;
}
.wcea-data-tabs .woocommerce-Tabs-panel {
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* ── Products Grid (Related / Upsell) ───────────────────────────────────────── */
.wcea-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--wcea-cols, 4), 1fr);
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.wcea-products-grid .product {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    text-align: center;
    padding: 12px;
}
.wcea-products-grid .product:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}
.wcea-products-grid .woocommerce-loop-product__link img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 10px;
}
.wcea-products-grid .woocommerce-loop-product__title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}
.wcea-products-grid .price {
    font-size: 15px;
    font-weight: 700;
    color: #7c3aed;
    margin-bottom: 10px;
}
.wcea-products-grid .button {
    display: inline-block;
    padding: 8px 16px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}
.wcea-products-grid .button:hover {
    background: #5b21b6;
    transform: translateY(-1px);
}

/* ── Section Headings ───────────────────────────────────────────────────────── */
.wcea-section-heading {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1f2937;
    position: relative;
    padding-bottom: 10px;
}
.wcea-section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: #7c3aed;
    border-radius: 2px;
}

/* ── Responsive Adjustments ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .wcea-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .wcea-gallery-wrap.wcea-thumb-left,
    .wcea-gallery-wrap.wcea-thumb-right {
        flex-direction: column;
    }
    .wcea-thumb-left .wcea-gallery-thumbs,
    .wcea-thumb-right .wcea-gallery-thumbs {
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
    }
}
@media (max-width: 480px) {
    .wcea-products-grid {
        grid-template-columns: 1fr !important;
    }
}
