/* Product Page Styles */

.product-page {
    padding-top: 100px; /* Account for fixed navbar height */
    padding-bottom: 80px;
}

.breadcrumbs {
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
    /* align-items: start; Removed to allow height stretching */
}

/* Left Column */
.product-left {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
}

.product-left > .product-title {
    margin-bottom: -16px; /* Reduce gap after title */
}

/* Gallery */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-image {
    width: 100%;
    background: #f0f0f0;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4/3;
    position: relative;
}

/* Blurred background layer */
.main-image::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    right: -10%;
    bottom: -10%;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    filter: blur(20px) saturate(1.4);
    opacity: 0.8;
    z-index: 1;
    transform: scale(1.1);
}

/* Main image - scaled to fit, not cropped */
.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

.thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
}

.thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

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

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

/* Section Titles */
.section-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* Matches List */
.matches-section .carousel-container {
    padding: 0;
}

/* Companion cards */
.companion-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.companion-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(44, 95, 45, 0.15);
}

.companion-reason {
    font-size: 11px;
    color: #6c757d;
    margin: 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
}

.companion-card .view-btn {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #2C5F2D 0%, #1a3a1b 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.companion-card .view-btn:hover {
    opacity: 0.9;
}

/* Description */
.description-content {
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 1rem;
}

.description-content p {
    margin-bottom: 16px;
}

/* Reviews */
.rating-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 1.2rem;
    font-weight: 700;
}

.stars {
    color: #FFC107;
}

.review-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stars-small {
    color: #FFC107;
    font-size: 0.8rem;
}

/* Right Column */
.product-right {
    position: relative;
}

.product-info-card {
    background: white;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    position: sticky;
    top: 100px; /* Below navbar */
}

.product-title {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 16px;
    color: #000000;
    height: auto;
    min-height: 0;
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 16px;
}

/* Variants */
.product-variants {
    margin-bottom: 32px;
}

.product-variants label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.variant-option {
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.variant-option:hover {
    border-color: var(--primary-color);
    background: rgba(44, 95, 45, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.15);
}

.variant-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Actions */
.product-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-main);
    transition: color 0.2s;
}

.qty-btn:hover {
    color: var(--primary-color);
}

.qty-input {
    width: 50px;
    text-align: center;
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.btn-add-cart {
    flex: 1;
    background: var(--gradient-primary);
    background-size: 200% 100%;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 8px;
}

.btn-add-cart:hover {
    background-position: 100% 0;
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3);
}

.btn-buy-now {
    width: 100%;
    padding: 16px;
    background: var(--gradient-primary);
    background-size: 200% 100%;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.btn-buy-now:hover {
    background-position: 100% 0;
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3);
}

/* Delivery Info */
.delivery-info-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f0fff4;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    color: var(--primary-dark);
}

.delivery-info-box i {
    font-size: 1.5rem;
}

.delivery-info-box strong {
    display: block;
    margin-bottom: 4px;
}

.delivery-info-box span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Loading and Error States */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    color: var(--text-secondary);
}

.error-container i {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 20px;
}

.error-container p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* Enhanced Variant Options */
.variant-option {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    text-align: center;
}

.variant-option:hover:not(.disabled) {
    border-color: var(--primary-color);
    background: rgba(44, 95, 45, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.15);
}

.variant-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.variant-option.selected:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    transform: none;
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.2);
}

.variant-option.selected .variant-price {
    color: rgba(255, 255, 255, 0.9);
}

.variant-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.variant-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.variant-price {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.variant-unavailable {
    font-size: 0.75rem;
    color: #e74c3c;
    margin-top: 4px;
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Disabled Buttons */
.btn-add-cart:disabled,
.btn-buy-now:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
}

.btn-add-cart:disabled:hover,
.btn-buy-now:disabled:hover {
    box-shadow: none;
}

/* Responsive */
@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .product-info-card {
        position: static;
        margin-top: 0;
    }
    
    .product-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .product-actions {
        flex-direction: column;
    }
    
    .quantity-selector {
        justify-content: space-between;
    }
    
    .btn-add-cart {
        padding: 16px;
    }
    
    .variant-options {
        flex-direction: column;
    }
    
    .variant-option {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
}
