/* Feria Catalog Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f4e4bc;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.badge.available { background: #d4edda; color: #155724; }
.badge.sold { background: #f8d7da; color: #721c24; }
.badge.reserved { background: #fff3cd; color: #856404; }
.badge.total { background: #d1ecf1; color: #0c5460; }

/* Filter Section */
.filter-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Compact Filter View */
.filter-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.current-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-label {
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 500;
}

#current-filter-text {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1rem;
}

.results-inline {
    color: #d4af37;
    font-weight: 600;
    font-size: 0.95rem;
}

.expand-filters-btn {
    background: #ffffff;
    border: 1px solid #d4af37;
    color: #d4af37;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expand-filters-btn:hover {
    background: #d4af37;
    color: white;
}

#expand-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* Advanced Filter Section */
.filter-advanced {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.filter-checkboxes {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-group h4 {
    color: #495057;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #495057;
    transition: color 0.3s ease;
}

.checkbox-label:hover {
    color: #2c3e50;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #d4af37;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-clear-filters,
.btn-close-filters {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-clear-filters {
    background: #6c757d;
    color: white;
}

.btn-clear-filters:hover {
    background: #495057;
    transform: translateY(-1px);
}

.btn-close-filters {
    background: #e9ecef;
    color: #495057;
}

.btn-close-filters:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.item-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: pointer;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.item-card.sold {
    opacity: 0.8;
}

.item-card.reserved {
    opacity: 0.9;
}

/* Item Photos */
.item-photos {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.item-photos img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.item-card:hover .item-photos img {
    transform: scale(1.05);
}

.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    background: #e9ecef;
}

.photo-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.sold-overlay,
.reserved-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.reserved-overlay {
    background: rgba(255, 193, 7, 0.9);
    color: #212529;
}

/* Item Info */
.item-info {
    padding: 1.5rem;
}

.item-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.item-code {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.item-description {
    color: #495057;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.item-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.state {
    color: #374151;
    font-weight: 500;
}

.quantity {
    color: #6c757d;
}

/* Pricing */
.price {
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #b8860b;
}

.reference-price {
    display: block;
    color: #6c757d;
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.sold-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #6c757d;
}

.reserved-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #fd7e14;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: #b8941f;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #25D366;
    color: white;
}

.btn-secondary:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

/* Item Detail Page */
.back-btn {
    color: #d4af37;
    text-decoration: none;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.back-btn:hover {
    text-decoration: underline;
}

.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.availability-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.availability-badge.available { background: #d4edda; color: #155724; }
.availability-badge.sold { background: #f8d7da; color: #721c24; }
.availability-badge.reserved { background: #fff3cd; color: #856404; }

/* 3-Row Layout */
.item-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.item-section:last-child {
    margin-bottom: 2rem;
}

/* Row 1: Photos and Description */
.photos-description {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.description-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Row 2: Price and Reference */
.price-reference {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    border: 2px solid #e9ecef;
}

.pricing-section {
    text-align: center;
    padding: 1rem;
}

.pricing-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.price-display {
    background: #faf6e8;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid #d4af37;
}

.reference-section {
    padding: 1rem;
}

.reference-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.reference-section .mt-2 {
    margin-top: 2rem;
}

/* Row 3: Actions */
.actions-section {
    background: #faf6e8;
    border: 2px solid #d4af37;
    text-align: center;
}

.contact-subtitle {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Gallery */
.item-gallery {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.main-photo {
    position: relative;
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
}

.main-photo img {
    width: 100%;
    height: 400px;
    object-fit: contain;
}

.no-photo-large {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 1.2rem;
    position: relative;
}

.sold-overlay-large,
.reserved-overlay-large {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.5rem;
}

.reserved-overlay-large {
    background: rgba(255, 193, 7, 0.9);
    color: #212529;
}

.photo-thumbnails {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #d4af37;
}

/* Detail Sections */
.detail-section {
    margin-bottom: 2rem;
}

.detail-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.label {
    font-weight: 600;
    color: #495057;
}

.value {
    color: #2c3e50;
}

.availability-status.available { color: #374151; }
.availability-status.sold { color: #dc3545; }
.availability-status.reserved { color: #fd7e14; }

/* Updated Pricing */
.current-price-large {
    font-size: 2.5rem;
    font-weight: bold;
    color: #b8860b;
    display: block;
}

.reference-link {
    color: #d4af37;
    text-decoration: none;
    font-weight: 500;
}

.reference-link:hover {
    text-decoration: underline;
}

.comments {
    background: #fff3cd;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    font-style: italic;
}

/* Contact Section */
.contact-section {
    background: transparent;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.contact-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Footer */
footer {
    border-top: 2px solid #f0f0f0;
    padding-top: 2rem;
    margin-top: 3rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    background: #f8f9fa;
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: -20px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
}

.contact-info h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.contact-info p {
    margin-bottom: 0.5rem;
    color: #495057;
}

.metadata {
    text-align: right;
    color: #6c757d;
    font-size: 0.9rem;
}

.metadata p {
    margin-bottom: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .stats {
        flex-direction: column;
        align-items: center;
    }

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

    .photos-description,
    .price-reference {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-compact {
        flex-direction: column;
        align-items: flex-start;
    }

    .expand-filters-btn {
        align-self: stretch;
        justify-content: center;
    }

    .filter-checkboxes {
        flex-direction: column;
        gap: 1.5rem;
    }

    .filter-actions {
        justify-content: stretch;
    }

    .filter-actions button {
        flex: 1;
    }

    .contact-buttons {
        flex-direction: column;
    }

    .item-gallery {
        position: static;
        margin-bottom: 2rem;
    }

    footer {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .metadata {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .item-info {
        padding: 1rem;
    }

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

    .main-photo img,
    .no-photo-large {
        height: 250px;
    }
}