/* ═══════════════════════════════════════════════════════════
   Product Page – Custom Styling
   ═══════════════════════════════════════════════════════════ */

/* ── Gallery Layout: thumbnails on the left ── */
.woocommerce div.product div.images {
    display: flex;
    flex-direction: row-reverse;
    gap: 12px;
    width: 50%;
    float: left;
}

.woocommerce div.product div.images .woocommerce-product-gallery__wrapper {
    flex: 1;
    order: 2;
}

.woocommerce div.product div.images .flex-control-thumbs {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    width: 80px;
    flex-shrink: 0;
    order: 1;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    width: 80px !important;
    margin: 0 !important;
    padding: 0;
    list-style: none;
}

.woocommerce div.product div.images .flex-control-thumbs li img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
    opacity: 0.6;
}

.woocommerce div.product div.images .flex-control-thumbs li img.flex-active,
.woocommerce div.product div.images .flex-control-thumbs li img:hover {
    border-color: #222;
    opacity: 1;
}

/* Main product image */
.woocommerce div.product div.images .woocommerce-product-gallery__image img {
    border-radius: 10px;
    background: #f5f5f5;
}

/* ── Product Summary ── */
.woocommerce div.product div.summary {
    width: 46%;
    float: right;
    padding-left: 30px;
}

/* Product title */
.woocommerce div.product .product_title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 12px;
}

/* Price */
.woocommerce div.product p.price,
.woocommerce div.product span.price {
    font-size: 28px !important;
    font-weight: 700;
    color: #e74c3c !important;
}

.woocommerce div.product p.price del {
    font-size: 18px !important;
    color: #999 !important;
    font-weight: 400;
}

.woocommerce div.product p.price ins {
    text-decoration: none;
    font-weight: 700;
}

/* SKU */
.woocommerce div.product .product_meta {
    font-size: 13px;
    color: #888;
    margin-top: 16px;
    border-top: 1px solid #eee;
    padding-top: 16px;
}

/* ── Stock Status ── */
.woocommerce div.product .stock {
    font-size: 14px;
    font-weight: 600;
    margin: 10px 0;
}

.woocommerce div.product .stock.in-stock {
    color: #2dcb73;
}

.woocommerce div.product .stock.out-of-stock {
    color: #e74c3c;
}

/* ── Variations Form (wrapper) ── */
.woocommerce div.product form.variations_form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Variation / Attribute Selector ── */
.woocommerce div.product form.variations_form .variations {
    width: 100%;
    margin-bottom: 16px;
    border-collapse: separate;
    border-spacing: 0;
}

.woocommerce div.product form.variations_form .variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.woocommerce div.product form.variations_form .variations td.label {
    display: block;
    padding: 0 0 8px;
    text-align: left;
}

.woocommerce div.product form.variations_form .variations td.label label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
    text-align: left;
}

.woocommerce div.product form.variations_form .variations td.value {
    display: block;
    padding: 0;
}

/* Style select as a nicer dropdown */
.woocommerce div.product form.variations_form .variations select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    color: #333;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.woocommerce div.product form.variations_form .variations select:focus {
    border-color: #222;
    outline: none;
}

/* Reset variation link */
.woocommerce div.product form.variations_form .reset_variations {
    font-size: 13px;
    color: #888;
    margin-top: 8px;
    display: inline-block;
}

/* ── Swatch Buttons (replaces select dropdown) ── */
.smfs-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.smfs-swatch-btn {
    min-width: 48px;
    height: 48px;
    padding: 0 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.smfs-swatch-btn:hover {
    border-color: #999;
}

.smfs-swatch-btn.smfs-swatch-active {
    border-color: #222;
    background: #222;
    color: #fff;
}

.smfs-swatch-btn.smfs-swatch-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #eee;
    color: #bbb;
    position: relative;
    overflow: hidden;
}

.smfs-swatch-btn.smfs-swatch-disabled::before,
.smfs-swatch-btn.smfs-swatch-disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    height: 2px;
    background: #bbb;
}

.smfs-swatch-btn.smfs-swatch-disabled::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.smfs-swatch-btn.smfs-swatch-disabled::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ── Cart form layout (qty + button wrapper) ── */
.woocommerce div.product form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 24px;
}

/* For variation form, the .single_variation_wrap contains qty + button */
.woocommerce div.product .single_variation_wrap {
    width: 100%;
}

.woocommerce div.product .single_variation_wrap .woocommerce-variation {
    margin-bottom: 16px;
}

.woocommerce div.product .single_variation_wrap .woocommerce-variation-add-to-cart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Quantity Selector ── */
.woocommerce div.product form.cart .quantity {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    height: 54px;
    width: 160px;
    flex-shrink: 0;
    margin: 0;
}

.woocommerce div.product form.cart .quantity .qty {
    width: 50px;
    height: 100%;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    -moz-appearance: textfield;
    background: transparent;
}

.woocommerce div.product form.cart .quantity .qty::-webkit-inner-spin-button,
.woocommerce div.product form.cart .quantity .qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Custom +/- buttons injected by JS */
.smfs-qty-btn-page {
    width: 48px;
    height: 100%;
    background: transparent;
    border: none;
    font-size: 22px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    user-select: none;
}

.smfs-qty-btn-page:hover {
    background: #f5f5f5;
}

/* ── Add to Cart Button ── */
.woocommerce div.product form.cart .single_add_to_cart_button {
    background: #00c853 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 16px 48px !important;
    font-size: 0 !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    width: 100%;
    height: 56px;
    line-height: 1 !important;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.woocommerce div.product form.cart .single_add_to_cart_button::after {
    content: 'COMPRAR';
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    background: #00a844 !important;
    transform: translateY(-1px);
}

.woocommerce div.product form.cart .single_add_to_cart_button:active {
    transform: translateY(0);
}

/* ── Breadcrumbs ── */
.woocommerce .woocommerce-breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 24px;
    padding: 10px 0;
}

.woocommerce .woocommerce-breadcrumb a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s;
}

.woocommerce .woocommerce-breadcrumb a:hover {
    color: #222;
}

/* ── Tabs ── */
.woocommerce div.product .woocommerce-tabs {
    clear: both;
    margin-top: 40px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    padding: 0;
    margin: 0 0 20px;
    list-style: none;
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    text-decoration: none;
    display: block;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #222;
    border-bottom-color: #222;
}

/* ── Related / Upsell Products ── */
.woocommerce div.product .related.products,
.woocommerce div.product .upsells.products {
    clear: both;
    padding-top: 50px;
}

.woocommerce div.product .related.products h2,
.woocommerce div.product .upsells.products h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 28px;
    color: #1a1a1a;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    /* Parent theme's <main id="main"> overflows viewport on single product pages — constrain it */
    body.single-product main#main.site-main {
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .woocommerce div.product div.images {
        width: 100%;
        float: none;
        flex-direction: column;
    }

    .woocommerce div.product div.images .flex-control-thumbs {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        order: 2;
    }

    .woocommerce div.product div.images .flex-control-thumbs li {
        width: 60px !important;
        flex-shrink: 0;
    }

    .woocommerce div.product div.images .flex-control-thumbs li img {
        height: 60px;
    }

    .woocommerce div.product div.images .woocommerce-product-gallery__wrapper {
        order: 1;
    }

    .woocommerce div.product div.summary {
        width: 100%;
        float: none;
        padding-left: 0;
        margin-top: 20px;
    }
}
