/* ============================================
   PRODUCT DETAIL PAGE - MODERN DESIGN
   ============================================ */

.product-detail-container {
    padding: 160px 0 80px;
    background: #f8f9fa;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

/* Breadcrumbs */
.breadcrumb-nav {
    background: white;
    padding: 15px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--primary-color, #F5A623);
}

.breadcrumb-separator {
    color: #ccc;
}

/* Main Product Section */
.product-main {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: start;
}

/* ============================================
   GALLERY SECTION
   ============================================ */

.product-gallery {
    position: sticky;
    top: 120px;
}

.main-image-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    aspect-ratio: 1;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.main-image-container:hover {
    transform: scale(1.02);
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

.badge-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.badge-discount {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.badge-featured {
    background: linear-gradient(135deg, #f5a623, #f76b1c);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4);
}

.badge-stock-low {
    background: rgba(255, 152, 0, 0.95);
    color: white;
}

/* Thumbnails */
.thumbnails-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.thumbnail {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.thumbnail:hover {
    border-color: var(--primary-color, #F5A623);
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: var(--primary-color, #F5A623);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

/* ============================================
   PRODUCT INFO SECTION
   ============================================ */

.product-info {
    position: relative;
}

.product-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color, #F5A623);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.product-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 15px;
    line-height: 1.2;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #666;
}

.meta-item i {
    color: var(--primary-color, #F5A623);
}

/* Price Section */
.price-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 16px;
    padding: 20px;
    padding-bottom: 25px;
    margin-bottom: 25px;
    position: relative;
    z-index: 5;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 15px;
}

.price-current {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-color, #F5A623);
    line-height: 1;
}

.price-original {
    font-size: 1.3rem;
    color: #999;
    text-decoration: line-through;
}

.price-savings {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #27ae60;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    position: relative;
    z-index: 5;
}

.price-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.price-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.price-detail-label {
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-detail-value {
    font-weight: 700;
    color: #1a1a1a;
}

/* Stock Status */
.stock-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 20px;
    width: 100%;
    clear: both;
}

.stock-available {
    background: #d4edda;
    color: #155724;
}

.stock-low {
    background: #fff3cd;
    color: #856404;
}

.stock-out {
    background: #f8d7da;
    color: #721c24;
}

/* Attributes */
.product-attributes {
    margin-bottom: 20px;
}

.attribute-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.attribute-label {
    font-weight: 700;
    color: #666;
    min-width: 80px;
    font-size: 0.85rem;
}

.attribute-value {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 0.85rem;
}

.color-swatch {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
    margin-left: 10px;
}

/* Actions */
.product-actions {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.quantity-label {
    font-weight: 700;
    color: #666;
    font-size: 0.9rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.qty-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: #f8f9fa;
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: var(--primary-color, #F5A623);
    color: white;
}

.qty-input {
    width: 70px;
    height: 45px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    outline: none;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-add-cart,
.btn-buy-now {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-cart {
    background: #2c3e50;
    color: white;
}

.btn-add-cart:hover {
    background: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.3);
}

.btn-buy-now {
    background: linear-gradient(135deg, #F5A623, #F76B1C);
    color: white;
}

.btn-buy-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 166, 35, 0.4);
}

/* Tabs */
.product-tabs {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.tabs-nav {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--primary-color, #F5A623);
}

.tab-btn.active {
    color: var(--primary-color, #F5A623);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color, #F5A623);
}

.tab-content {
    display: none;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 25px 0;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Specs Table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.specs-table td {
    padding: 15px;
    font-size: 0.95rem;
}

.specs-table td:first-child {
    font-weight: 700;
    color: #666;
    width: 30%;
}

.specs-table td:last-child {
    color: #1a1a1a;
}

/* Related Products */
.related-products {
    margin: 60px 0;
}

.related-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 40px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* ============================================
   ZOOM MODAL
   ============================================ */

.zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    padding: 20px;
}

.zoom-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.zoom-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.zoom-image.zoomed {
    cursor: zoom-out;
    transform: scale(1.5);
}

.zoom-close {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s;
}

.zoom-close:hover {
    background: var(--primary-color, #F5A623);
    color: white;
    transform: rotate(90deg);
}

.zoom-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10001;
}

.zoom-nav:hover {
    background: var(--primary-color, #F5A623);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.zoom-prev {
    left: 30px;
}

.zoom-next {
    right: 30px;
}

.zoom-counter {
    position: fixed;
    bottom: 30px;
    left: 50% !;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    z-index: 10001;
}

/* Responsive */
@media (max-width: 968px) {
    .product-detail-container {
        padding: 100px 0 60px;
    }

    .product-main {
        padding: 15px;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .product-gallery {
        position: static;
    }

    .product-title {
        font-size: 1.6rem;
    }

    .price-current {
        font-size: 2rem;
    }

    .price-section {
        padding: 15px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .price-details {
        grid-template-columns: 1fr;
    }

    .product-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

    .btn-add-cart,
    .btn-buy-now {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .product-main {
        padding: 12px;
        border-radius: 12px;
    }

    .product-title {
        font-size: 1.4rem;
    }

    .price-current {
        font-size: 1.8rem;
    }

    .price-original {
        font-size: 1.1rem;
    }

    .meta-item {
        font-size: 0.75rem;
    }

    .product-attributes {
        margin-bottom: 15px;
    }

    .attribute-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .product-tabs {
        padding: 20px 15px;
    }
}

/* ============================================
   CRITICAL STYLES & FIXES (Overrides)
   ============================================ */

.product-tabs {
    margin-top: 40px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    height: auto !important;
    min-height: 200px;
    overflow: visible !important;
    display: flow-root;
}

.tabs-nav {
    display: flex;
    gap: 15px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 25px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #F5A623;
    border-bottom-color: #F5A623;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
    height: auto !important;
    overflow: visible !important;
}

.tab-content.active {
    display: flow-root !important;
}

.description-container {
    height: auto !important;
    overflow: visible !important;
    width: 100%;
}

.product-description {
    line-height: 1.8 !important;
    color: #333;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal !important;
}

.product-description * {
    max-width: 100% !important;
    height: auto !important;
    white-space: normal !important;
}

.product-description p,
.product-description div,
.product-description span {
    display: block;
    margin-bottom: 1em;
    line-height: 1.8 !important;
}

.product-description img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 15px auto;
    border-radius: 8px;
}

.product-description br {
    display: block;
    content: "";
    margin-top: 0.5em;
}

.shipping-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 10px;
}

.shipping-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 1.5rem;
    color: #555;
}

.shipping-icon img {
    max-width: 100%;
    max-height: 100%;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.installments-table {
    width: 100%;
    border-collapse: collapse;
}

.installments-table td,
.installments-table th {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.badge-best {
    background: #F5A623;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 5px;
}