/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Professional CSS Styles */
.product-detail-container {
    position: relative;
    width: 90%;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: 'Inter', sans-serif;
    color: #2d3748;
}

.product-main {
    position: relative;
    display: flex;
    gap: 3rem;
    background: #ffffff;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    align-items: flex-start;
    justify-content: space-between;
}

.product-gallery {
    width: 45%;
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.gallery-main {
    width: 100%;
    margin-top: 0;
    margin-bottom: 1rem;
    overflow: hidden;
}

.gallery-main img {
    display: none;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    background: #f8f9fa;
}

.gallery-main img:hover {
    transform: scale(1.02);
}

.gallery-main img.active {
    display: block;
}

.gallery-thumbnails-wrapper {
    width: 100%;
    max-width: calc(80px * 4 + 0.75rem * 3); /* Show 4 thumbnails + 3 gaps */
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.gallery-thumbnails {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ff4444 #ffe6e6;
    width: 100%;
    justify-content: flex-start;
    max-width: 100%;
    position: relative;
}

.gallery-thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    flex: 0 0 80px;
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
    margin: 0;
    background: #fff;
    padding: 4px;
}

.gallery-thumbnails img:hover {
    border-color: #5d3737;
    transform: translateY(1px);
}

.gallery-thumbnails img.active {
    border-color: #ff4444;
    border-width: 1px;
}

.product-price-info {
    width: 55%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}   


.product-header {
    box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.08);
    padding-bottom: 0.25rem;
}

.product-detail-title {
    font-size: 2.2rem;
    font-weight: 700;
    height: auto;
    max-height: 120px;
    letter-spacing: -0.5px;
    color: #1a202c;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    box-orient: vertical;
    white-space: normal;
    margin-bottom: 15px;
}


.product-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    color: #718096;
}

.product-pricing {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #fff5f5;
    border-radius: 12px;
}

.price-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.current-price {
    font-size: 2rem;
    color: #ff4444;
    text-shadow: 0 2px 4px rgba(255, 68, 68, 0.1);
}

.original-price {
    font-size: 1.2rem;
    color: #6c757d;
    text-decoration: line-through;
}

.discount-badge {
    background: linear-gradient(135deg, #ff4444, #ff6b6b);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(255, 68, 68, 0.2);
}

.product-description h3 {
    font-size: 1.2rem;
    color: #2c3e50;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-input {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    background: none;
    border: none;
    padding: 0.5rem 1.25rem;
    font-size: 1.1rem;
    cursor: pointer;
    color: #ff4444;
    transition: background 0.2s ease;
}

.quantity-btn:hover {
    background: #fff5f5;
}

.quantity-input input {
    width: 40px;
    border: none;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    padding: 0.5rem;
}

.add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #ff4444, #ff6b6b);
    color: white;
    padding: 1.25rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.25);
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 68, 68, 0.35);
}

.cart-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.add-to-cart:hover .cart-icon {
    transform: rotate(-10deg) scale(1.1);
}

.product-specs {
    display: grid;
    gap: 0.75rem;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.spec-label {
    font-weight: 500;
    color: #4a5568;
}

.spec-value {
    color: #2c3e50;
}

.product-info {
    display: none;
}

.tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #f0f4f9;
}

.tab {
    padding: 1rem 2.5rem;
    font-weight: 600;
    color: #718096;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
    position: relative;
    background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
}

.tab.active {
    color: #ff4444;
    background: #ffffff;
    border: 1px solid #ffe6e6;
    border-bottom-color: transparent;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #ff4444, #ff8888);
}

.tab:hover:not(.active) {
    color: #ff4444;
    background: #fff5f5;
}

.product-description h2,
.product-parameters h3 {
    color: #cc0000;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ffe0e0;
}

.product-description,
.product-parameters {
    display: none;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.product-parameters ul {
    list-style: none;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-description.active,
.product-parameters.active {
    display: block;
}

.product-description p {
    color: #444;
    line-height: 1.8;
    font-size: 1.05rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
}



.product-parameters ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-parameters ul li:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.param-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    padding-left: 1.2rem;
}

.param-name::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ff4444;
    font-size: 1.4rem;
    line-height: 1;
    top: 65%;
    transform: translateY(-50%);
}

.param-value {
    font-weight: 700;
    color: #ff4444;
    font-size: 1rem;
    background: linear-gradient(135deg, #fff5f5 0%, #ffecec 100%);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    white-space: nowrap;
    margin-left: auto;
}

.product-info.full-width-content {
    flex: 0 1 100% !important;
    max-width: 100% !important;
    margin: 0 3rem !important;
}

/* Single Tab State */
.tabs.single-tab {
    display: none;
}

.tabs.single-tab .tab {
    display: none;
}

.tabs.single-tab .tab.active {
    display: none;
}

.tabs.single-tab .tab.active::after {
    display: none;
}
/* .tabs.single-tab {
    border-bottom: none;
    width: fit-content;
}

.tabs.single-tab .tab {
    border-bottom: 1px solid #e5e5e5;
    width: 100%;
}

.tabs.single-tab .tab.active {
    border-bottom-color: #ffdada;
}

.tabs.single-tab .tab.active::after {
    display: none;
} */

/* Mobile styles */
@media (max-width: 900px) {
    .product-detail-container {
        width: 100%;
        padding: 0;
        margin: 0.5rem 0;
    }

    .product-main {
        width: 100%;
        margin: 0 auto;
        padding: 0.5rem;
        gap: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        flex-direction: column;
    }

    .product-gallery,
    .product-price-info {
        width: 100%;
        padding: 0.5rem;
        margin: 0;
        box-shadow: none;
        border: none;
    }

    .product-header {
        padding-bottom: 0.5rem;
    }

    .product-detail-title {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .product-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.85rem;
    }

    .tabs {
        display: flex;
        border-bottom: 1px solid #e5e5e5;
        margin: 0.5rem 0;
    }
    
    .tab {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: #666;
        cursor: pointer;
        position: relative;
    }
    
    .tab.active {
        color: #ff3e3e;
    }
    
    .tab.active::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: #ff3e3e;
    }
    
    .tab-content {
        flex: 1;
        min-height: 100px;
        margin-bottom: 1rem;
    }

    .product-pricing {
        margin: 1rem 0;
        padding: 1rem;
        flex-wrap: wrap;
    }

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

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

    .product-actions {
        gap: 1rem;
    }

    .quantity-selector {
        gap: 0.5rem;
        width: 100%;
        justify-content: space-between;
    }

    .add-to-cart {
        padding: 1rem;
        font-size: 0.9rem;
        width: 100%;
    }

    .product-specs {
        padding: 1rem;
        margin-top: 0.5rem;
    }

    .product-description,
    .product-parameters {
        padding: 0.5rem 0;
        margin: 0.5rem 0;
    }

    .product-description p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .product-parameters ul {
        padding: 8px;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .product-parameters ul li {
        width: 100%;
    }
    
    .param-name {
        font-size: 0.9rem;
    }
    
    .param-value {
        font-size: 1rem;
        padding: 0.3rem 0.6rem;
    }

    /* Mobile gallery adjustments */
    .gallery-main img {
        max-height: 400px;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .gallery-thumbnails-wrapper {
        max-width: 100%;
    }

    .gallery-thumbnails {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0.5rem;
        width: 100%;
        max-width: 100%;
    }

    .gallery-thumbnails img {
        width: 60px;
        height: 60px;
        object-fit: contain;
        flex: 0 0 60px;
        background: #fff;
        padding: 4px;
    }

    /* Mobile order */
    .product-gallery {
        order: 1;
    }

    .product-price-info {
        order: 2;
    }

    .product-parameters ul li {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .product-main {
        width: 98%;
    }

    .gallery-main img {
        max-height: 300px;
    }

    .gallery-thumbnails img {
        width: 50px;
        height: 50px;
        flex: 0 0 50px;
    }

    .product-detail-title {
        font-size: 1.3rem;
    }

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

/* Handle case when product-info doesn't exist */
.product-main:not(:has(.product-info)) {
    .product-gallery {
        width: 100%;
    }

    .product-price-info {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .param-name {
        max-width: 60%;
    }
}

@media (max-width: 1200px) {
    .product-parameters ul {
        padding: 6px;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}