/**
 * Catalog Frontend Styles
 * 
 * Uses Ensemble CSS Variables for consistent theming:
 * --ensemble-primary, --ensemble-secondary, --ensemble-text, etc.
 */

.es-catalog {
    /* Inherit from Ensemble Design Settings */
    font-family: var(--ensemble-font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: var(--ensemble-body-size, 16px);
    line-height: var(--ensemble-line-height-body, 1.6);
    color: var(--ensemble-text, #1f2937);
}

/* Filter Bar */
.es-catalog-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ensemble-card-border, rgba(255,255,255,0.1));
}

.es-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--ensemble-card-border, #e5e7eb);
    background: var(--ensemble-card-bg, #fff);
    color: var(--ensemble-text, #1f2937);
    border-radius: var(--ensemble-button-radius, 20px);
    font-size: var(--ensemble-small-size, 14px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.es-filter-btn:hover {
    border-color: var(--ensemble-primary, #3582c4);
    color: var(--ensemble-primary, #3582c4);
}

.es-filter-btn.active {
    background: var(--ensemble-primary, #3582c4);
    border-color: var(--ensemble-primary, #3582c4);
    color: var(--ensemble-button-text, #fff);
}

/* Catalog Header */
.es-catalog-header {
    margin-bottom: 24px;
}

.es-catalog-title {
    margin: 0;
    font-family: var(--ensemble-font-heading, inherit);
    font-size: var(--ensemble-h2-size, 24px);
    font-weight: var(--ensemble-heading-weight, 700);
    color: var(--ensemble-text, #1f2937);
}

.es-catalog-subtitle {
    margin: 8px 0 0;
    font-size: var(--ensemble-body-size, 16px);
    color: var(--ensemble-text-secondary, #6b7280);
}

/* Category */
.es-catalog-category {
    margin-bottom: 32px;
}

.es-category-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ensemble-primary, #3582c4);
}

.es-category-title {
    margin: 0;
    font-family: var(--ensemble-font-body, inherit);
    font-size: var(--ensemble-small-size, 14px);
    font-weight: 600;
    color: var(--ensemble-text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.es-category-desc {
    margin: 4px 0 0;
    font-size: var(--ensemble-small-size, 13px);
    color: var(--ensemble-text-secondary, #6b7280);
}

/* Items Container */
.es-catalog-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Single Item - List Layout (Default) */
.es-catalog-item {
    display: flex;
    gap: 16px;
    padding: var(--ensemble-card-padding, 16px);
    background: var(--ensemble-card-bg, #f9fafb);
    border: 1px solid var(--ensemble-card-border, transparent);
    border-radius: var(--ensemble-card-radius, 8px);
    transition: background 0.2s ease;
}

.es-catalog-item:hover {
    background: var(--ensemble-hover, #f3f4f6);
}

.es-item-image {
    width: 80px;
    height: 80px;
    border-radius: calc(var(--ensemble-card-radius, 8px) / 2);
    overflow: hidden;
    flex-shrink: 0;
}

.es-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.es-item-info {
    flex: 1;
    min-width: 0;
}

.es-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 4px;
}

.es-item-name {
    margin: 0;
    font-family: var(--ensemble-font-heading, inherit);
    font-size: var(--ensemble-body-size, 16px);
    font-weight: var(--ensemble-heading-weight, 600);
    color: var(--ensemble-text, #1f2937);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.es-item-price {
    font-size: var(--ensemble-body-size, 16px);
    font-weight: var(--ensemble-heading-weight, 600);
    color: var(--ensemble-primary, #3582c4);
    white-space: nowrap;
}

.es-item-price small {
    font-size: var(--ensemble-small-size, 12px);
    font-weight: var(--ensemble-body-weight, 400);
    color: var(--ensemble-text-secondary, #6b7280);
}

.es-item-desc {
    margin: 0 0 8px;
    font-size: var(--ensemble-small-size, 14px);
    color: var(--ensemble-text-secondary, #6b7280);
}

.es-item-details {
    font-size: calc(var(--ensemble-small-size, 14px) - 1px);
    color: var(--ensemble-text-secondary, #6b7280);
}

.es-item-details .es-allergens {
    color: #9ca3af;
    font-size: 12px;
}

/* Badges */
.es-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.es-badge-new { background: #fef3c7; color: #92400e; }
.es-badge-highlight { background: #fef9c3; color: #854d0e; }
.es-badge-vegan { background: #dcfce7; color: #166534; }
.es-badge-veg { background: #d1fae5; color: #065f46; }
.es-badge-sale { background: #fee2e2; color: #991b1b; }
.es-badge-limited { background: #ede9fe; color: #5b21b6; }
.es-badge-popular { background: #ffedd5; color: #9a3412; }

/* Includes (Services) */
.es-item-includes {
    margin-top: 8px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
}

.es-item-includes strong {
    display: block;
    margin-bottom: 4px;
    color: #374151;
}

/* Amenities (Rooms) */
.es-item-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.es-amenity {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    padding: 4px 8px;
    background: #e5e7eb;
    border-radius: 4px;
}

/* ========================================
   LAYOUT VARIATIONS
   ======================================== */

/* Grid Layout */
.es-catalog-layout-grid .es-catalog-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.es-catalog-layout-grid .es-catalog-item {
    flex-direction: column;
}

.es-catalog-layout-grid .es-item-image {
    width: 100%;
    height: 160px;
}

/* Compact Layout */
.es-catalog-layout-compact .es-catalog-item {
    padding: 12px 16px;
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
}

.es-catalog-layout-compact .es-catalog-item:last-child {
    border-bottom: none;
}

.es-catalog-layout-compact .es-item-header {
    margin-bottom: 0;
}

.es-catalog-layout-compact .es-item-name {
    font-size: 15px;
}

.es-catalog-layout-compact .es-item-desc {
    display: none;
}

/* Multi-column */
.es-catalog-cols-2 .es-catalog-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.es-catalog-cols-3 .es-catalog-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ========================================
   TYPE-SPECIFIC STYLES
   ======================================== */

/* Menu / Drinks - Classic style */
.es-catalog[data-type="menu"] .es-item-header,
.es-catalog[data-type="drinks"] .es-item-header {
    position: relative;
}

.es-catalog[data-type="menu"] .es-item-name::after,
.es-catalog[data-type="drinks"] .es-item-name::after {
    content: '';
    flex: 1;
    min-width: 20px;
    border-bottom: 1px dotted #d1d5db;
    margin: 0 12px 4px;
}

/* Merchandise - Card style */
.es-catalog[data-type="merchandise"] .es-catalog-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.es-catalog[data-type="merchandise"] .es-catalog-item {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.es-catalog[data-type="merchandise"] .es-item-image {
    width: 100%;
    height: 180px;
    margin-bottom: 12px;
}

.es-catalog[data-type="merchandise"] .es-item-header {
    flex-direction: column;
    align-items: center;
}

.es-catalog[data-type="merchandise"] .es-item-name::after {
    display: none;
}

/* Rooms - Large cards */
.es-catalog[data-type="rooms"] .es-catalog-item {
    flex-direction: column;
    padding: 24px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.es-catalog[data-type="rooms"] .es-item-image {
    width: 100%;
    height: 200px;
    margin-bottom: 16px;
}

/* Sponsoring - Highlight style */
.es-catalog[data-type="sponsoring"] .es-catalog-item {
    padding: 24px;
    border: 2px solid #e5e7eb;
    background: linear-gradient(to bottom, #fff, #f9fafb);
    border-radius: 12px;
}

.es-catalog[data-type="sponsoring"] .es-catalog-item:first-child {
    border-color: #fbbf24;
    background: linear-gradient(to bottom, #fffbeb, #fef3c7);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .es-catalog-cols-2 .es-catalog-items,
    .es-catalog-cols-3 .es-catalog-items {
        grid-template-columns: 1fr;
    }
    
    .es-catalog-layout-grid .es-catalog-items {
        grid-template-columns: 1fr;
    }
    
    .es-catalog[data-type="merchandise"] .es-catalog-items {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .es-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .es-item-name::after {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .es-catalog[data-type="merchandise"] .es-catalog-items {
        grid-template-columns: 1fr;
    }
    
    .es-filter-btn {
        flex: 1;
        text-align: center;
    }
}

/* ========================================
   THEME SUPPORT
   Inherits from Ensemble Design System
   No manual dark/light mode needed - uses template variables
   ======================================== */

/* All colors are controlled by Ensemble CSS variables:
   --ensemble-text
   --ensemble-text-secondary  
   --ensemble-card-bg
   --ensemble-card-border
   --ensemble-hover
   --ensemble-primary
*/
