/**
 * Casa Cuir - Product Detail Page CSS Extension
 * 
 * MINIMAL overrides on top of the Amerce theme's native classes.
 * Only adds enhancements specific to the product detail page
 * that aren't covered by the base styles.css.
 * 
 * Native theme classes used (DO NOT duplicate):
 *   .banner-product-single, .tf-product-media-wrap, .product-thumbs-slider,
 *   .tf-product-info-wrap, .tf-product-info-heading, .product-infor-price,
 *   .tf-product-variant, .tf-product-total-quantity, .group-action,
 *   .wg-quantity, .btn-quantity, .tf-btn, .tf-product-extra-link,
 *   .tf-product-delivery-return, .tf-product-trust-seal,
 *   .section-product-description, .tf-product-tab, etc.
 */

/* ============================================================
   BREADCRUMB
   ============================================================ */
.tf-breadcrumb {
    padding: 12px 0;
    background: var(--bg, #f8f8f8);
}
.tf-breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--text-2, #666);
}
.tf-breadcrumb-item.link {
    color: var(--text-2, #666);
    text-decoration: none;
    transition: color 0.2s;
}
.tf-breadcrumb-item.link:hover {
    color: var(--primary, #95C11F);
}
.tf-breadcrumb-item.fw-medium {
    color: var(--text, #1a1a1a);
}
.tf-breadcrumb-item .icon {
    font-size: 10px;
    opacity: 0.5;
}

/* ============================================================
   STOCK BADGE (shared with quickview.css)
   ============================================================ */
.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
}
.stock-badge.in-stock {
    color: #16a34a;
}
.stock-badge.out-of-stock {
    color: #dc2626;
}

/* ============================================================
   PRODUCT ATTRIBUTES TABLE (shared with quickview.css)
   ============================================================ */
.tf-product-attrs {
    display: grid;
    gap: 8px;
    padding: 12px 0;
}
.tf-product-attrs .attr-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.tf-product-attrs .attr-label {
    font-weight: 500;
    min-width: 100px;
    color: var(--text-2, #666);
    font-size: 14px;
}
.tf-product-attrs .attr-value {
    color: var(--text, #1a1a1a);
    font-size: 14px;
}

/* ============================================================
   VARIANT PICKER — modern design
   ============================================================ */
.tf-product-variant {
    padding: 4px 0 8px;
}
.tf-product-variant .quick-variant-picker {
    margin-bottom: 16px;
}
.tf-product-variant .variant-picker_label {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1;
}
.tf-product-variant .variant-picker_values {
    gap: 10px !important;
}

/* --- Color circles --- */
.tf-product-variant .picker_color .color_btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 50%;
    padding: 3px;
    border: 2px solid transparent;
    transition: border-color 0.25s ease, transform 0.2s ease;
}
.tf-product-variant .picker_color .color_btn .img {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.25s ease;
}
.tf-product-variant .picker_color .color_btn:hover {
    border-color: var(--text-2, #999);
    transform: scale(1.1);
}
.tf-product-variant .picker_color .color_btn:hover .img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.tf-product-variant .picker_color .color_btn.active {
    border-color: var(--text, #1a1a1a);
}
.tf-product-variant .picker_color .color_btn.active .img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* Tooltip label on hover */
.tf-product-variant .picker_color .color_btn::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--text, #1a1a1a);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.tf-product-variant .picker_color .color_btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Size / text buttons --- */
.tf-product-variant .picker_size .size_btn {
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================================
   PRODUCT DOCS & VIDEOS
   ============================================================ */
.tf-product-docs,
.tf-product-videos {
    padding: 12px 0;
}
.tf-product-docs a,
.tf-product-videos a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg, #f8f8f8);
    color: var(--text, #1a1a1a);
    font-size: 14px;
    transition: background 0.2s;
    margin-bottom: 4px;
}
.tf-product-docs a:hover,
.tf-product-videos a:hover {
    background: var(--line, #e5e5e5);
}
.tf-product-docs a .icon,
.tf-product-videos a .icon {
    font-size: 16px;
    color: var(--primary, #95C11F);
}

/* ============================================================
   PRODUCT TABS (description, specs, shipping)
   ============================================================ */
.tf-product-tab .nav-tabs {
    border-bottom: 2px solid var(--line, #e5e5e5);
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tf-product-tab .nav-tabs::-webkit-scrollbar {
    display: none;
}
.tf-product-tab .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 12px 20px;
    font-weight: 500;
    color: var(--text-2, #666);
    white-space: nowrap;
    transition: all 0.25s;
}
.tf-product-tab .nav-link:hover {
    color: var(--text, #1a1a1a);
}
.tf-product-tab .nav-link.active {
    color: var(--primary, #95C11F);
    border-bottom-color: var(--primary, #95C11F);
}
.tf-product-tab .tab-content {
    padding: 24px 0;
}
.tf-product-tab .tf-rte {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-2, #666);
}
.tf-product-tab .tf-rte h6 {
    color: var(--text, #1a1a1a);
}
.tf-product-tab .tf-rte ul {
    padding-left: 20px;
}
.tf-product-tab .tf-rte ul li {
    margin-bottom: 8px;
}
.tf-product-tab .tf-sizeguide-table {
    width: 100%;
    border-collapse: collapse;
}
.tf-product-tab .tf-sizeguide-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--line, #e5e5e5);
    font-size: 14px;
}
.tf-product-tab .tf-sizeguide-table tr:last-child td {
    border-bottom: none;
}
.tf-product-tab .tf-sizeguide-table td:first-child {
    width: 180px;
    color: var(--text-2, #666);
    background: var(--bg, #fafafa);
}

/* ============================================================
   STICKY ADD-TO-CART (mobile bottom bar)
   ============================================================ */
.tf-sticky-btn-atc {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white, #fff);
    border-top: 1px solid var(--line, #e5e5e5);
    padding: 10px 0;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.tf-sticky-btn-atc.visible {
    transform: translateY(0);
}
.tf-sticky-btn-atc img {
    border-radius: 4px;
    object-fit: cover;
}

/* ============================================================
   PRODUCT IMAGE GALLERY ENHANCEMENTS
   ============================================================ */
.tf-product-media-wrap {
    position: relative;
}
.section-product-single .tf-product-media-main .item {
    cursor: zoom-in;
}
/* Badges overlay on the main product image */
.pd-badges {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 5;
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}
/* Gallery: override theme's object-fit:cover to show full product image */
.banner-product-single .product-thumbs-slider .tf-product-media-main .item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px;
    background: var(--bg, #fafafa);
    height: auto !important;
}
.banner-product-single .product-thumbs-slider .tf-product-media-main .item img {
    width: 100% !important;
    height: auto !important;
    max-height: 600px;
    object-fit: contain !important;
}
/* Thumbs: ensure visible at all breakpoints */
.banner-product-single .tf-product-media-thumbs .item {
    border-radius: 8px;
    overflow: hidden;
}
.banner-product-single .tf-product-media-thumbs .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Mobile/tablet: thumbs horizontal below the main image */
@media (max-width: 1199px) {
    .banner-product-single .tf-product-media-thumbs {
        width: 100% !important;
        margin-top: 10px;
    }
    .banner-product-single .tf-product-media-thumbs .swiper-slide {
        width: 80px !important;
        height: 80px !important;
    }
    .banner-product-single .product-thumbs-slider .tf-product-media-main .item img {
        max-height: 450px;
    }
}
/* Desktop: thumbs vertical on the left */
@media (min-width: 1200px) {
    .banner-product-single .tf-product-media-thumbs .tf-product-thumb {
        height: 500px;
    }
    .banner-product-single .tf-product-media-thumbs .swiper-slide {
        height: auto;
    }
}

/* ============================================================
   SHARE BUTTON
   ============================================================ */
.pd-share-tooltip {
    position: absolute;
    background: var(--white, #fff);
    border: 1px solid var(--line, #e5e5e5);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
}
.pd-share-tooltip.active {
    display: flex;
    gap: 12px;
}
.pd-share-tooltip a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg, #f5f5f5);
    color: var(--text, #1a1a1a);
    font-size: 16px;
    transition: all 0.2s;
}
.pd-share-tooltip a:hover {
    background: var(--primary, #95C11F);
    color: var(--white, #fff);
}

/* ============================================================
   RELATED PRODUCTS
   ============================================================ */
.heading-section .heading-title {
    font-size: 24px;
    letter-spacing: -0.5px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Mobile : < 576px */
@media (max-width: 575.98px) {
    .tf-breadcrumb-list {
        font-size: 12px;
    }
    .section-product-single .tf-product-info-wrap {
        margin-top: 20px;
    }
    .tf-product-tab .nav-link {
        padding: 10px 14px;
        font-size: 14px;
    }
    .tf-product-tab .tf-sizeguide-table td:first-child {
        width: 120px;
    }
    .heading-section .heading-title {
        font-size: 20px;
    }
}

/* Tablet : 576px - 1199px */
@media (min-width: 576px) and (max-width: 1199.98px) {
    .section-product-single .tf-product-info-wrap {
        margin-top: 24px;
    }
}

/* Desktop : >= 1200px */
@media (min-width: 1200px) {
    .section-product-single .tf-product-info-wrap {
        margin-top: 0;
        position: sticky;
        top: 80px;
    }
    .tf-sticky-btn-atc {
        display: none !important;
    }
}

/* Toolbar mobile offset when sticky is visible */
@media (max-width: 1199.98px) {
    .tf-sticky-btn-atc.visible ~ .tf-toolbar-bottom {
        bottom: 66px;
    }
}
