/**
 * Product Catalog Styles
 */

/* Hero Section */
.catalog-hero {
    background: #0a0a1a;
    color: white;
    padding: 6rem 5vw;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 256px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.star {
    position: absolute;
    background: white;
    width: 2px;
    height: 2px;
    box-shadow: 0 0 2px white;
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeIn 1.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.catalog-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(255, 105, 180, 0.3);
    letter-spacing: 2px;
}

.catalog-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 900px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.85);
}

/* Main Container */
main.container {
    padding: 88px 5vw;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Filter Bar */
.catalog-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 34px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d2d2d7;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    color: #1d1d1f;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.product-image {
    width: 100%;
    height: 180px;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255,255,255,0.95);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #667eea;
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1d1d1f;
}

.product-size {
    color: #6e6e73;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.product-features {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.feature-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6e6e73;
}

.feature-icon {
    width: 16px;
    height: 16px;
}

/* Material Swatches */
.material-swatches {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.material-label {
    font-size: 0.75rem;
    color: #6e6e73;
    font-weight: 600;
}

.swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e5e5e7;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.swatch:hover {
    border-color: #667eea;
    transform: scale(1.1);
}

.swatch-more {
    font-size: 0.75rem;
    color: #667eea;
    font-weight: 600;
}

/* Price */
.product-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
    margin-top: auto;
}

.price-label {
    font-size: 0.875rem;
    color: #6e6e73;
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d1d1f;
}

/* Actions */
.product-actions {
    display: flex;
    gap: 0.75rem;
}

.btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-secondary:hover {
    background: #f5f5f7;
}

/* Quick Look Modal - Uses Modal Component */
.product-quick-look-modal .modal-body {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.quick-look-body {
    display: grid;
    grid-template-columns: minmax(0, 35fr) minmax(0, 65fr);
    gap: 2rem;
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.modal-footer-actions {
    border-top: 1px solid #e5e5e7;
    padding: 1.25rem 2rem;
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* Modal Gallery */
.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.modal-details {
    min-width: 0;
}

.modal-main-image {
    width: 100%;
    height: 280px;
    background: #f5f5f7;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
}

.modal-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.95);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s;
    z-index: 10;
}

.carousel-nav:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.carousel-nav.prev {
    left: 1rem;
}

.carousel-nav.next {
    right: 1rem;
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

.modal-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.modal-thumb {
    min-width: 60px;
    width: 60px;
    height: 60px;
    background: #f5f5f7;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    overflow: hidden;
    position: relative;
}

.modal-thumb:hover,
.modal-thumb.active {
    border-color: #667eea;
}

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

.thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.625rem;
    padding: 0.25rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Modal Details */
.product-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e5e5e7;
    min-width: 0;
}

.modal-details h2 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal-details .product-size {
    margin: 0 0 0.75rem 0;
    color: #6e6e73;
    font-size: 0.9rem;
}

.product-price-badge {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.product-price-badge .price-label {
    font-size: 0.8rem;
    color: #6e6e73;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-price-badge .price-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: #1d1d1f;
    font-weight: 600;
}

.modal-section p {
    color: #6e6e73;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Config Sections */
.config-section {
    margin-bottom: 2rem;
}

.config-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Features List */
.features-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #6e6e73;
    font-size: 0.9rem;
    line-height: 1.8;
}

.features-list li {
    margin-bottom: 0.5rem;
}

/* Product Description */
.product-description {
    color: #6e6e73;
    line-height: 1.6;
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure material swatches wrap properly */
.material-swatches-row {
    max-width: 100%;
}

.selected-material-name {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Compact Material Swatches */
.material-swatches-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.material-swatch {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}

.material-swatch:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.material-swatch.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.material-swatch.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
}

.material-swatch.out-of-stock:hover {
    transform: none;
    border-color: transparent;
}

.swatch-color {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.swatch-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.material-swatch.selected .swatch-check {
    opacity: 1;
}

.selected-material-name {
    font-size: 0.9rem;
    color: #1d1d1f;
    font-weight: 500;
}

/* Info Note */
.info-note {
    padding: 0.75rem 1rem;
    background: #fffbeb;
    border-radius: 8px;
    border-left: 3px solid #fbbf24;
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .catalog-hero {
        padding: 4rem 2rem;
        min-height: 300px;
    }

    .catalog-hero h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .catalog-hero p {
        font-size: 1rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .quick-look-body {
        grid-template-columns: 1fr;
    }

    .modal-main-image {
        height: 300px;
    }

    .product-card {
        max-width: 500px;
        margin: 0 auto;
    }

    .modal-materials-grid {
        grid-template-columns: 1fr;
    }
}

/* Empty State */
.catalog-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.catalog-empty h2 {
    font-size: 1.5rem;
    color: #6e6e73;
    margin-bottom: 1rem;
}

.catalog-empty p {
    color: #86868b;
}
