/* ================================================
   NiceWatch - Redesigned Product Page CSS
   ================================================ */

/* === LAYOUT === */
.nw-sp-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px 40px;
    overflow-x: hidden;
}

/* Override parent theme constraints for single product */
.nw-sp-wrap #primary.nw-sp-fullwidth {
    width: 100%;
    float: none;
    max-width: 100%;
}
.nw-sp-wrap #primary.nw-sp-fullwidth #main {
    width: 100%;
    max-width: 100%;
}

.nw-single-product {
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: #1a1a1a;
}

/* === BREADCRUMB === */
.nw-sp-breadcrumb {
    padding: 14px 0;
    font-size: 12px;
    color: #999;
}
.nw-sp-breadcrumb a {
    color: #888;
    text-decoration: none;
}
.nw-sp-breadcrumb a:hover {
    color: #c0392b;
}

/* === PRODUCT TOP: 2 columns === */
.nw-sp-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
    align-items: start;
}

/* === GALLERY === */
.nw-sp-gallery-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #f0f0f0;
}
.nw-sp-gallery-main img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

@media (max-width: 768px) {
    .nw-sp-gallery-main {
        width: 100% !important;
        overflow: hidden;
    }
    .nw-sp-gallery-main img {
        width: 100% !important;
    }
    .nw-sp-info {
        width: 98% !important;
        overflow: hidden;
    }
    /* Prevent all content from overflowing viewport */
    .nw-sp-wrap,
    .nw-single-product,
    .nw-sp-top,
    .nw-sp-gallery,
    .nw-sp-cart-actions,
    .nw-sp-plugin-zone {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    /* Buttons must stay within container */
    .nw-sp-cart-actions .single_add_to_cart_button,
    .nw-sp-cart-actions #buy_now_button,
    .nw-sp-cart-actions .cart,
    .nw-sp-plugin-zone a,
    .nw-sp-plugin-zone button,
    .nw-sp-plugin-zone div {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .nw-sp-cart-actions .quantity {
        width: auto !important;
    }
}
.nw-sp-badge-sale {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #c0392b;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    z-index: 2;
}
.nw-sp-zoom-link {
    display: block;
    position: relative;
}
.nw-sp-zoom-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    opacity: 0;
    transition: opacity 0.2s;
}
.nw-sp-gallery-main:hover .nw-sp-zoom-icon {
    opacity: 1;
}

/* Thumbnails */
.nw-sp-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    flex-wrap: nowrap;
}
.nw-sp-thumb {
    width: 72px;
    min-width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: all 0.2s;
}
.nw-sp-thumb.active {
    border-color: #c0392b;
    opacity: 1;
}
.nw-sp-thumb:hover {
    opacity: 0.8;
}
.nw-sp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === PRODUCT INFO === */
.nw-sp-brand {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}
.nw-sp-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 20px;
    color: #1a1a1a;
}

/* Price Block */
.nw-sp-price-block {
    background: linear-gradient(135deg, #fff8f6, #fff);
    border: 1px solid #f0e0dc;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.nw-sp-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}
.nw-sp-price-sale {
    font-size: 28px;
    font-weight: 700;
    color: #c0392b;
}
.nw-sp-price-sale .woocommerce-Price-amount {
    font-size: inherit !important;
    color: #c0392b !important;
}
.nw-sp-price-regular {
    font-size: 15px;
    color: #888;
}
.nw-sp-price-regular .woocommerce-Price-amount {
    color: #888 !important;
    font-size: inherit !important;
    font-weight: 400 !important;
}
.nw-sp-price-saving {
    font-size: 13px;
    color: #27ae60;
}
.nw-sp-price-saving strong {
    color: #27ae60;
}
.nw-sp-price-saving .woocommerce-Price-amount {
    color: #27ae60 !important;
    font-size: inherit !important;
    font-weight: 600 !important;
}

/* Trust Signals */
.nw-sp-trust {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}
.nw-sp-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f8f6;
    border-radius: 8px;
}
.nw-sp-trust-item svg {
    flex-shrink: 0;
    color: #c0392b;
}
.nw-trust-main {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}
.nw-trust-sub {
    display: block;
    font-size: 11px;
    color: #999;
}

/* Quick Specs / Short Description */
.nw-sp-quick-specs {
    margin-bottom: 20px;
}
.nw-sp-short-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
}
.nw-sp-short-desc p {
    margin: 0 0 8px;
}
/* Font Awesome icons in short description */
.nw-sp-short-desc .fa,
.nw-sp-short-desc .fas,
.nw-sp-short-desc .far,
.nw-sp-short-desc i[class*="fa-"] {
    color: #27ae60;
    margin-right: 4px;
}

/* Cart Actions - override WooCommerce default form styling */
.nw-sp-cart-actions .cart {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.nw-sp-cart-actions .quantity {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}
.nw-sp-cart-actions .quantity .qty {
    width: 48px;
    height: 44px;
    text-align: center;
    border: none;
    font-size: 14px;
    font-weight: 500;
    -moz-appearance: textfield;
}
.nw-sp-cart-actions .quantity .qty::-webkit-inner-spin-button,
.nw-sp-cart-actions .quantity .qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* Add to Cart button → secondary */
.nw-sp-cart-actions .single_add_to_cart_button {
    flex: 1;
    height: 48px;
    background: transparent;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 160px;
}
.nw-sp-cart-actions .single_add_to_cart_button:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

/* Buy Now button → primary */
.nw-sp-cart-actions #buy_now_button {
    width: 100%;
    height: 52px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.15s;
    margin-top: 0;
}
.nw-sp-cart-actions #buy_now_button:hover {
    background: #a5311f;
    transform: translateY(-1px);
}
.nw-sp-cart-actions #buy_now_button b {
    display: block;
    font-size: 16px;
}
.nw-sp-cart-actions #buy_now_button span {
    display: block;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 2px;
}

/* Out of stock */
.nw-sp-out-of-stock {
    padding: 20px;
    background: #fef5f5;
    border: 1px solid #f5ddd8;
    border-radius: 10px;
    text-align: center;
    color: #c0392b;
    font-size: 14px;
}

/* Hotline */
.nw-sp-hotline {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: #888;
}
.nw-sp-hotline a {
    color: #c0392b;
    font-weight: 600;
    text-decoration: none;
}
.nw-sp-hotline span {
    color: #bbb;
    font-size: 12px;
}

/* Meta */
.nw-sp-meta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #999;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.nw-sp-meta a {
    color: #888;
    text-decoration: none;
}
.nw-sp-meta a:hover {
    color: #c0392b;
}

/* === TABS === */
.nw-sp-tabs-wrap {
    margin-bottom: 48px;
}
.nw-sp-tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 28px;
    overflow-x: auto;
}
.nw-sp-tab-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 400;
    border: none;
    background: none;
    cursor: pointer;
    color: #888;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}
.nw-sp-tab-btn.active {
    color: #c0392b;
    font-weight: 600;
    border-bottom-color: #c0392b;
}
.nw-sp-tab-btn:hover {
    color: #333;
}

/* Tab content */
.nw-sp-tab-panel {
    display: none;
    max-width: 100%;
    font-size: 14px;
    color: #444;
    line-height: 1.8;
}
.nw-sp-tab-panel.active {
    display: block;
}
.nw-sp-tab-panel h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 16px;
}
.nw-sp-tab-panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 12px;
}
.nw-sp-tab-panel img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}
.nw-sp-tab-panel ul,
.nw-sp-tab-panel ol {
    padding-left: 20px;
    margin: 12px 0;
}
.nw-sp-tab-panel li {
    margin-bottom: 6px;
}

/* === RELATED PRODUCTS === */
.nw-sp-related-wrap {
    margin-bottom: 40px;
}
.nw-sp-related-wrap .related.products {
    display: block !important;
}
.nw-sp-related-wrap .related.products > h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: block;
    width: 100%;
}
.nw-sp-related-wrap .products,
.woocommerce .nw-sp-related-wrap ul.products,
.woocommerce-page .nw-sp-related-wrap ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-flow: row !important;
    gap: 16px !important;
    list-style: none;
    padding: 0;
    margin: 0;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    align-content: start;
    justify-items: stretch;
}
.nw-sp-related-wrap .products::before,
.nw-sp-related-wrap .products::after,
.woocommerce .nw-sp-related-wrap ul.products::before,
.woocommerce .nw-sp-related-wrap ul.products::after {
    display: none !important;
    content: none !important;
}
/* Override WC .columns-N from parent theme */
.nw-sp-related-wrap ul.products[class*="columns-"],
.woocommerce .nw-sp-related-wrap ul.products[class*="columns-"] {
    display: grid !important;
    grid-auto-flow: row !important;
    gap: 16px !important;
}
.nw-sp-related-wrap .products li.product,
.woocommerce .nw-sp-related-wrap ul.products li.product,
.woocommerce-page .nw-sp-related-wrap ul.products li.product {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-bottom: 0 !important;
    list-style: none !important;
    position: relative;
    text-align: left;
    justify-self: stretch;
    align-self: start;
}
.nw-sp-related-wrap .products li.product:hover,
.woocommerce .nw-sp-related-wrap ul.products li.product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
/* Product thumbnail link — MUST be block and fill card */
.nw-sp-related-wrap .products li.product > a:first-child,
.woocommerce .nw-sp-related-wrap ul.products li.product > a:first-child,
.nw-sp-related-wrap .products li.product > a.woocommerce-LoopProduct-link {
    display: block !important;
    width: 100% !important;
    position: relative;
    overflow: hidden;
    background: #f5f5f3;
}
/* Force product image to fill the card */
.nw-sp-related-wrap .products li.product img,
.nw-sp-related-wrap .products li.product a img,
.woocommerce .nw-sp-related-wrap ul.products li.product a img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    min-width: 100% !important;
    display: block !important;
    aspect-ratio: 1/1;
    object-fit: cover;
}
/* Add to cart / Read more buttons */
.nw-sp-related-wrap .products li.product > a.button,
.nw-sp-related-wrap .products li.product > a.add_to_cart_button,
.woocommerce .nw-sp-related-wrap ul.products li.product > a.button,
.woocommerce .nw-sp-related-wrap ul.products li.product > a.add_to_cart_button {
    display: block !important;
    width: auto !important;
    margin: 0 12px 12px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    text-align: center !important;
    border-radius: 6px;
    background: #f5f5f3 !important;
    color: #333 !important;
    border: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}
/* Hide noscript duplicate images */
.nw-sp-related-wrap .products li.product noscript {
    display: none;
}
.nw-sp-related-wrap .products li.product .woocommerce-loop-product__title,
.woocommerce .nw-sp-related-wrap ul.products li.product .woocommerce-loop-product__title {
    font-size: 13px !important;
    padding: 8px 12px 4px !important;
    color: #333;
    font-weight: 400;
    line-height: 1.4;
    margin: 0 !important;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.nw-sp-related-wrap .products li.product .price,
.woocommerce .nw-sp-related-wrap ul.products li.product .price {
    padding: 0 12px 12px !important;
    font-size: 14px;
    word-break: break-all;
    text-align: center;
}
.nw-sp-related-wrap .products li.product .price ins,
.woocommerce .nw-sp-related-wrap ul.products li.product .price ins {
    text-decoration: none;
    color: #c0392b;
    font-weight: 600;
}
.nw-sp-related-wrap .products li.product .price del,
.woocommerce .nw-sp-related-wrap ul.products li.product .price del {
    color: #bbb;
    font-size: 12px;
}
/* Price responsive */
@media (max-width: 768px) {
    .nw-sp-related-wrap .products li.product .price,
    .woocommerce .nw-sp-related-wrap ul.products li.product .price {
        font-size: 12px !important;
        padding: 0 8px 8px !important;
    }
    .nw-sp-related-wrap .products li.product .price del {
        font-size: 10px;
    }
    /* Remove font-size overrides on price amount — let it inherit from .price */
    .nw-sp-related-wrap .products li.product .woocommerce-Price-amount {
        font-size: inherit !important;
        font-weight: inherit !important;
    }
    .nw-sp-related-wrap .products li.product .woocommerce-loop-product__title,
    .woocommerce .nw-sp-related-wrap ul.products li.product .woocommerce-loop-product__title {
        font-size: 11px !important;
        padding: 6px 8px 2px !important;
    }
    .nw-sp-related-wrap .products li.product > a.button,
    .nw-sp-related-wrap .products li.product > a.add_to_cart_button {
        margin: 0 8px 8px !important;
        padding: 6px 8px !important;
        font-size: 10px !important;
    }
    /* Hide sale badge in related products on mobile */
    .nw-sp-related-wrap .products li.product .onsale {
        display: none !important;
    }
}

/* === STICKY BAR === */
.nw-sp-sticky-bar {
    position: fixed;
    bottom: -80px;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
    z-index: 999;
    transition: bottom 0.3s ease;
    padding: 10px 0;
}
.nw-sp-sticky-bar.visible {
    bottom: 0;
}
.nw-sp-sticky-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nw-sp-sticky-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nw-sticky-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
}
.nw-sticky-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nw-sticky-price {
    font-size: 16px;
    font-weight: 600;
    color: #c0392b;
}
.nw-sticky-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 32px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: all 0.15s;
}
.nw-sticky-buy-btn:hover {
    background: #a5311f;
    color: #fff;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nw-sp-top {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .nw-sp-trust {
        grid-template-columns: 1fr;
    }
    .nw-sp-related-wrap .products,
    .woocommerce .nw-sp-related-wrap ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .nw-sp-title {
        font-size: 20px;
    }
    .nw-sp-price-sale {
        font-size: 24px;
    }
    .nw-sp-tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    .nw-sp-tabs-wrap .nw-sp-tab-panel {
        max-width: 100%;
    }
    /* Hide sticky bar on mobile — user has floating contact buttons already */
    .nw-sp-sticky-bar {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .nw-sp-wrap {
        padding: 0 12px 24px;
    }
    .nw-sp-gallery-thumbs {
        gap: 6px;
    }
    .nw-sp-thumb {
        width: 56px;
        height: 56px;
    }
    .nw-sp-price-block {
        padding: 16px;
    }
    .nw-sp-trust {
        gap: 6px;
    }
    .nw-sp-trust-item {
        padding: 8px 10px;
    }
    .nw-sp-cart-actions .cart {
        flex-direction: column;
    }
    .nw-sp-cart-actions .single_add_to_cart_button {
        width: 100%;
    }
    .nw-sp-related-wrap .products {
        gap: 10px;
    }
}

/* === OVERRIDE: Hide default WC elements we replaced === */
.nw-single-product .woocommerce-product-rating,
.nw-single-product .product_meta {
    display: none;
}

/* === Plugin Zone: BaoKim, installment, payment buttons === */
.nw-sp-plugin-zone {
    margin-top: 12px;
}
.nw-sp-plugin-zone .bk-btn-box,
.nw-sp-plugin-zone .bk-btn {
    width: 100%;
    border-radius: 10px;
    font-size: 14px;
}
/* Style BaoKim button to match our design */
.nw-sp-cart-actions + .nw-sp-plugin-zone .bk-btn-box a,
.nw-sp-cart-actions + .nw-sp-plugin-zone .bk-btn-box button,
.bk-btn-box a,
.bk-btn-box button {
    width: 100%;
    display: block;
    text-align: center;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
    box-sizing: border-box;
}

/* Also handle BaoKim injecting directly after the cart form */
.nw-sp-cart-actions .bk-btn-box {
    margin-top: 10px;
}
.nw-sp-cart-actions .bk-btn-box a,
.nw-sp-cart-actions .bk-btn-box button {
    width: 100%;
    display: block;
    text-align: center;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 500;
}

/* === Sight price block compatibility === */
.nw-sp-info .Sight_single_price {
    display: none;
}
