/* ============================================================
   SINGLE PRODUCT PAGE
   All tokens inherited from style.css :root
   ============================================================ */

/* ---- LAYOUT ---- */
.ms-single-product {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    gap: 40px;
}

/* ---- LEFT: GALLERY ---- */
.ms-product-gallery-section {
    flex: 1;
    min-width: 300px;
    display: flex;
    gap: 16px;
}

.ms-product-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 60px;
    flex-shrink: 0;
}

.ms-gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 1.5px solid var(--border-default);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.ms-gallery-thumb.active {
    border-color: var(--primary);
}

.ms-product-main-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.ms-product-main-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

/* Plugin banners under main image */
.ms-plugin-banners {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
    width: 100%;
}

.ms-plugin-banner-img {
    width: 500px;
    max-width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    margin: 0 auto;
}

/* ---- RIGHT: DETAILS ---- */
.ms-product-details-section {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Badge */
.ms-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-11);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.5px;
    font-family: var(--font-family);
}

.ms-text-red { color: var(--primary); }

/* Title */
.ms-product-title {
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    color: var(--text);
    font-size: var(--fs-40);
    line-height: 44px;
    margin: 0;
    text-transform: uppercase;
}

/* Price + Rating */
.ms-price-rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-default);
}

.ms-price {
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    color: var(--text);
    font-size: var(--fs-20);
    line-height: 32px;
}

.ms-rating {
    font-size: var(--fs-14);
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-family);
}

.ms-star { color: var(--star-color); }


    margin-left: 2px;
}

/* ============================================================
   VARIATIONS / CART FORM — CSS Grid for precise row control
   ============================================================ */
.ms-variations-wrapper form.cart {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Simple product: same grid as variable product buttons */
.ms-variations-wrapper form.cart:not(.variations_form) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.ms-variations-wrapper form.cart:not(.variations_form) .ms-qty-label {
    grid-column: 1 / -1;
}

.ms-variations-wrapper form.cart:not(.variations_form) .ms-product-promo {
    grid-column: 1 / -1;
}

.ms-variations-wrapper form.cart:not(.variations_form) .quantity {
    grid-column: 1 / -1;
    justify-self: start;
}

.ms-variations-wrapper form.cart:not(.variations_form) .single_add_to_cart_button {
    grid-column: 1;
}

.ms-variations-wrapper form.cart:not(.variations_form) .ms-buy-now {
    grid-column: 2;
}

/* variations table */
.ms-variations-wrapper table.variations {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.ms-variations-wrapper table.variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.ms-variations-wrapper table.variations td {
    display: block;
    padding: 0;
}

.ms-variations-wrapper table.variations td.label {
    padding-bottom: 4px;
}

.ms-variations-wrapper table.variations label {
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    color: var(--text);
    font-size: var(--fs-16);
    line-height: 26px;
    white-space: nowrap;
}

.ms-variations-wrapper .reset_variations { display: none !important; }

.ms-variations-wrapper select {
    width: 100%;
    padding: 12px 40px 12px 14px;
    border: 1.5px solid var(--border-medium);
    border-radius: 8px;
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    color: var(--text);
    font-size: 16px;
    line-height: 26px;
    appearance: none;
    background: url('data:image/svg+xml;utf8,<svg width="10" height="6" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L5 5L9 1" stroke="%23333" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 14px center;
    background-color: var(--white);
    cursor: pointer;
}

/* ---- Grid: qty + promo + buttons ---- */
.ms-variations-wrapper .woocommerce-variation-add-to-cart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
}

/* Qty label — full row */
.ms-qty-label {
    grid-column: 1 / -1;
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    color: var(--text);
    font-size: 16px;
    line-height: 26px;
    margin-bottom: -4px;
}

/* Quantity stepper — full row, left-aligned */
.ms-variations-wrapper .quantity {
    grid-column: 1 / -1;
    justify-self: start;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border-medium);
    border-radius: 50px;
    height: 48px;
    width: 130px;
    overflow: hidden;
    background: var(--white);
}

.ms-variations-wrapper .quantity input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    width: 44px;
    border: none;
    text-align: center;
    font-size: var(--fs-15);
    font-weight: 500;
    background: transparent;
    outline: none;
    font-family: var(--font-family);
    color: var(--text);
}

.ms-variations-wrapper .quantity input[type="number"]::-webkit-outer-spin-button,
.ms-variations-wrapper .quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ms-variations-wrapper .ms-qty-btn {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--fs-20);
    font-weight: 300;
    color: var(--text-gray-500);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Promo box — full row */
.ms-product-promo {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 14px;
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 10px;
    padding: 14px 16px;
}

.ms-promo-text {
    display: flex;
    flex-direction: column;
    font-family: var(--font-family);
}

.ms-promo-text strong {
    font-size: var(--fs-14);
    font-weight: var(--font-weight-bold);
    color: var(--success-text);
}

.ms-promo-text span {
    font-size: var(--fs-13);
    color: var(--success-text-light);
}

/* Add to cart button — col 1 */
.ms-variations-wrapper .single_add_to_cart_button {
    grid-column: 1;
    background-color: var(--button-secondary-bg);
    color: var(--button-secondary-text);
    border: none;
    height: 54px;
    border-radius: 50px;
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    font-size: var(--fs-16);
    cursor: pointer;
    transition: opacity 0.2s;
    padding: 0 16px;
    white-space: nowrap;
}

/* Buy now button — col 2 */
.ms-buy-now {
    grid-column: 2;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    height: 54px;
    border-radius: 50px;
    font-family: var(--font-family);
    font-size: var(--fs-16);
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    text-align: center;
    padding: 0 16px;
    white-space: nowrap;
}

.ms-variations-wrapper .single_add_to_cart_button:hover,
.ms-buy-now:hover { opacity: 0.88; }

/* WhatsApp button */
.ms-whatsapp-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 20px;
    background: #25D366;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: var(--fs-14);
    border-radius: 50px;
    transition: opacity 0.2s;
}

.ms-whatsapp-link:hover {
    opacity: 0.85;
}

.ms-whatsapp-link svg {
    flex-shrink: 0;
}

/* ---- Features ---- */
.ms-product-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    text-align: center;
    padding-top: 4px;
}

.ms-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ms-feature svg {
    width: 24px;
    height: 24px;
    color: var(--text-gray-500);
}

.ms-feature span {
    font-family: var(--font-family);
    font-size: var(--fs-9);
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    text-transform: uppercase;
    color: #333;
}

/* ---- Often bought with ---- */
.ms-often-bought {
    border: 1.5px solid var(--border-default);
    border-radius: 10px;
    padding: 18px;
}

.ms-often-bought h3 {
    font-family: var(--font-family);
    font-size: var(--h3);
    font-weight: var(--font-weight-normal);
    margin: 0 0 14px;
    color: var(--text-gray-600);
}

.ms-bought-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-light);
}

.ms-bought-item:last-child { border-bottom: none; padding-bottom: 0; }

.ms-bought-img {
    width: 44px;
    height: 52px;
    background-color: var(--bg-gray-100);
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
}

.ms-bought-img img { width: 100%; height: 100%; object-fit: cover; }

.ms-bought-info { flex: 1; }

.ms-bought-info h4 {
    font-family: var(--font-family);
    font-size: var(--h4);
    font-weight: var(--font-weight-bold);
    margin: 0 0 3px;
    text-transform: uppercase;
    color: var(--text);
}

.ms-bought-price {
    font-family: var(--font-family);
    font-size: var(--fs-11);
    color: var(--text-gray-600);
}

.ms-add-bought {
    background-color: var(--bg-light);
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-family);
    font-size: var(--fs-11);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.ms-add-bought:hover { background-color: var(--border-strong); }

/* ---- FAQs ---- */
.ms-faqs { margin-top: 8px; }

.ms-faq-item { border-bottom: 1px solid var(--border-default); padding: 14px 0; }

.ms-faq-question {
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    color: var(--text);
    font-size: var(--fs-16);
    line-height: 26px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.ms-faq-answer {
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    color: var(--text);
    font-size: var(--fs-16);
    line-height: 26px;
    margin-top: 8px;
    display: none;
}

.ms-faq-item.active .ms-faq-answer { display: block; }
.ms-faq-icon { font-size: var(--fs-20); transition: transform 0.2s; }
.ms-faq-item.active .ms-faq-icon { transform: rotate(45deg); }

/* ---- Video Banner ---- */
.ms-video-banner-wrap {
    width: 100%;
    margin-top: 40px;
    overflow: hidden;
    position: relative;
}

.ms-video-banner {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 600px;
    object-fit: cover;
    display: block;
}

.ms-video-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 600px;
    background: var(--gray-200, #e0e0e0) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.ms-video-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.15);
}

.ms-video-play-icon {
    position: relative;
    z-index: 1;
    color: var(--white, #fff);
    opacity: 0.9;
    transition: transform 0.2s, opacity 0.2s;
}

.ms-video-placeholder:hover .ms-video-play-icon {
    transform: scale(1.1);
    opacity: 1;
}

.ms-video-loaded {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .ms-single-product { flex-direction: column; gap: 24px; }
    .ms-product-gallery-section { position: static; flex-direction: column-reverse; }
    .ms-product-thumbnails {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 4px;
    }
    .ms-product-thumbnails::-webkit-scrollbar { display: none; }
    .ms-gallery-thumb {
        flex: 0 0 52px;
        scroll-snap-align: start;
    }
    .ms-product-details-section { max-width: 100%; }
    .ms-product-title { font-size: var(--fs-28); line-height: 34px; }
    .ms-video-banner {
        max-height: 300px;
        aspect-ratio: 4 / 3;
    }
}