/* ==========================================================================
   FAVORIT98 BAKERY CATALOG - HIGH-DENSITY DESKTOP OVERRIDES (static/theme.css)
   ========================================================================== */

/* 1. WIDEN CONTAINERS & KEEP CONSISTENT SIDE MARGINS ACROSS ALL TABS */
:root { --max-width: 1480px; }
.main-wrapper { width: 100%; max-width: 100%; margin: 0 auto; padding: 0; box-sizing: border-box; }
.header-container, .alert-content, .footer-container, .catalog-container, .product-detail-container, .container { max-width: var(--max-width) !important; padding-left: 1.25rem !important; padding-right: 1.25rem !important; width: 100%; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.header-container { padding-top: 0.65rem !important; padding-bottom: 0.65rem !important; }
.main-navigation a.active::after { bottom: -0.75rem !important; }
.container-padding { padding: 24px 1.25rem !important; }

/* 2. COMPACT CATALOG HEADER & HORIZONTAL SEARCH/FILTER TOOLBAR */
.catalog-container { padding-top: 1.25rem !important; padding-bottom: 2rem !important; }
.catalog-header { margin-bottom: 1.5rem !important; text-align: left !important; display: flex; flex-direction: column; gap: 0.75rem; }
.catalog-header h1 { font-size: 1.85rem !important; margin-bottom: 0.15rem !important; line-height: 1.2; }
.catalog-subtitle { font-size: 0.95rem !important; margin-bottom: 0.5rem !important; }
.search-filter-wrapper { padding: 0.75rem 1rem !important; gap: 0.75rem !important; display: flex !important; flex-direction: column; }

@media (min-width: 960px) {
    .search-filter-wrapper { flex-direction: row !important; align-items: center !important; justify-content: space-between !important; position: sticky; top: 62px; z-index: 90; }
    #catalogSearchInput { max-width: 300px !important; flex-shrink: 0; }
    .filter-badge-container { justify-content: flex-end !important; }
}

#catalogSearchInput { padding: 0.55rem 0.85rem !important; font-size: 0.9rem !important; }
.filter-badge { padding: 0.4rem 0.9rem !important; font-size: 0.875rem !important; }

/* 3. HIGH-DENSITY PRODUCT GRID (5-6 COLUMNS ON DESKTOP, 2 ON MOBILE) */
.catalog-section { margin-bottom: 2.25rem !important; }
.category-title { font-size: 1.35rem !important; margin-bottom: 1rem !important; padding-bottom: 0.35rem !important; }
.products-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.75rem !important; }

@media (min-width: 640px) { .products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 1rem !important; } }
@media (min-width: 1024px) { .products-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 1rem !important; } }
@media (min-width: 1360px) { .products-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 1rem !important; } }

/* 4. COMPACT PRODUCT CARDS & IMAGE CONTAINMENT */
.product-card { display: flex !important; flex-direction: column !important; height: 100% !important; }
.product-card-link { display: flex; flex-direction: column; height: 100%; }
.product-image-wrapper { position: relative !important; height: 155px !important; background-color: #fcfaf6 !important; display: flex !important; align-items: center !important; justify-content: center !important; overflow: hidden !important; padding: 8px !important; border-radius: 8px 8px 0 0 !important; }
@media (max-width: 639px) { .product-image-wrapper { height: 140px !important; } }
.product-image-wrapper picture { display: block !important; width: 100% !important; height: 100% !important; }
.product-image-wrapper picture img, .product-image-wrapper .catalog-item-img { width: 100% !important; height: 100% !important; object-fit: contain !important; object-position: center !important; max-width: 100% !important; max-height: 100% !important; padding: 0 !important; transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important; }
.product-card:hover .product-image-wrapper picture img { transform: scale(1.04) !important; }
.product-info-summary { display: flex !important; flex-direction: column !important; flex-grow: 1 !important; justify-content: space-between !important; padding: 0.7rem 0.8rem !important; gap: 0.45rem !important; background: #ffffff !important; }
.product-item-name { font-size: 0.92rem !important; line-height: 1.3 !important; margin-bottom: 0 !important; font-weight: 700 !important; color: #4a3319 !important; }
.view-details-btn { font-size: 0.8rem !important; }

/* 5. UNIFIED PAGE HEADERS & INFO/TECH GRIDS */
.page-section-header { text-align: center; margin-bottom: 32px; }
.main-title { font-size: 2rem; color: #333333; margin-bottom: 10px; font-weight: 700; }
.subtitle { font-size: 1rem; color: #666666; max-width: 760px; margin: 0 auto; line-height: 1.5; }
.section-divider-title { font-size: 1.5rem; color: #333333; margin: 28px 0 18px 0; border-bottom: 2px solid #f4ede4; padding-bottom: 8px; }
.tech-hero-card { background-color: #fcfbf9; border-left: 4px solid var(--color-primary, #8B5A2B); padding: 20px; border-radius: 4px; margin-bottom: 24px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.tech-hero-card h2 { margin-top: 0; color: #222; }
.tech-hero-card p { line-height: 1.6; color: #555; font-size: 1rem; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-bottom: 30px; }
.tech-card { background: #ffffff; border: 1px solid #eaeaea; border-radius: 8px; padding: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.01); transition: transform 0.2s ease; }
.tech-card:hover { transform: translateY(-2px); }
.tech-card-icon { font-size: 1.75rem; margin-bottom: 10px; }
.tech-card h3 { margin: 0 0 10px 0; font-size: 1.15rem; color: #222; }
.tech-card p { color: #666; line-height: 1.5; font-size: 0.92rem; margin-bottom: 12px; }
.tech-specs-list { padding-left: 18px; margin: 0; color: #444; font-size: 0.88rem; line-height: 1.5; }
.tech-specs-list li { margin-bottom: 5px; }
.tech-footer-statement { background: #fdfaf6; border-radius: 8px; padding: 22px; text-align: center; margin-top: 32px; border: 1px dashed #e2d1bc; }
.tech-footer-statement h3 { margin-top: 0; color: #444; }
.tech-footer-statement p { max-width: 900px; margin: 0 auto; line-height: 1.6; color: #666; }
.about-layout-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 850px) { .about-layout-grid { grid-template-columns: 1fr; } }
.history-block h2, .values-section h2 { color: #222; margin-bottom: 12px; }
.history-block p { line-height: 1.6; color: #555; margin-bottom: 16px; }
.values-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.value-item-card { background: #ffffff; border-radius: 6px; padding: 14px 18px; border-left: 3px solid #e6dfd5; }
.value-item-card h4 { margin: 0 0 4px 0; font-size: 1.05rem; color: #333; }
.value-item-card p { margin: 0; font-size: 0.92rem; color: #666; line-height: 1.5; }
.metric-sidebar-box { background: #fdfcfb; border: 1px solid #f0eae1; border-radius: 8px; padding: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.01); }
.metric-sidebar-box h3 { margin-top: 0; border-bottom: 1px solid #f0eae1; padding-bottom: 8px; color: #333; }
.metric-num-item { display: flex; flex-direction: column; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed #f0eae1; }
.metric-num-item:last-of-type { border-bottom: none; margin-bottom: 8px; }
.metric-number { font-size: 1.9rem; font-weight: 800; color: var(--color-primary, #8B5A2B); line-height: 1.1; }
.metric-label { font-size: 0.88rem; color: #666; margin-top: 4px; }
.metric-sidebar-quote { background: #ffffff; border-radius: 4px; padding: 12px; border-left: 2px solid var(--color-primary, #8B5A2B); font-style: italic; font-size: 0.88rem; color: #555; line-height: 1.5; }

/* 6. HEADER LOGO LAYOUT CONSTRAINTS */
.logo a { display: flex; align-items: center; height: 100%; min-height: 36px; text-decoration: none; }
.logo-img { height: auto; max-height: 40px; width: auto; max-width: 170px; object-fit: contain; display: inline-block; vertical-align: middle; }
#logo-text-fallback { font-size: 1.4rem; font-weight: 800; color: var(--color-primary, #8B5A2B); letter-spacing: 1px; text-transform: uppercase; }

/* 7. HOMEPAGE CONTAINER WIDTH MATCH (KEEPING ORIGINAL LAYOUT) */
.hero-container, .main-content-grid { max-width: var(--max-width) !important; padding-left: 1.25rem !important; padding-right: 1.25rem !important; }

/* 8. TOP IMAGE CAROUSEL (ABOVE EXISTING HERO SECTION) */
.top-image-carousel-wrapper { max-width: var(--max-width) !important; margin: 1.25rem auto 0 auto; padding: 0 1.25rem; box-sizing: border-box; }
.hero-carousel { position: relative; width: 100%; height: 400px; border-radius: 10px; overflow: hidden; background: #f4ede4; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
@media (max-width: 768px) { .hero-carousel { height: 240px; border-radius: 8px; } }
.carousel-track { position: relative; width: 100%; height: 100%; }
.carousel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease-in-out; pointer-events: none; }
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; background: rgba(44, 29, 17, 0.45); backdrop-filter: blur(4px); color: #ffffff; border: 1px solid rgba(255,255,255,0.4); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.carousel-arrow:hover { background: #8b5a2b; border-color: #8b5a2b; }
.carousel-arrow.prev { left: 14px; }
.carousel-arrow.next { right: 14px; }
@media (max-width: 640px) { .carousel-arrow { width: 30px; height: 30px; font-size: 0.9rem; } .carousel-arrow.prev { left: 8px; } .carousel-arrow.next { right: 8px; } }
.carousel-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 8px; background: rgba(44, 29, 17, 0.35); padding: 5px 10px; border-radius: 20px; }
.carousel-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,0.5); cursor: pointer; padding: 0; transition: transform 0.2s, background 0.2s; }
.carousel-dot.active { background: #ffffff; transform: scale(1.25); }

/* 9. TECHNOLOGY PAGE 2x2 IMAGE GALLERY (views/technology.tpl) */
.tech-gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0 0 30px 0; }
@media (max-width: 560px) { .tech-gallery-grid { grid-template-columns: 1fr; } }
.tech-gallery-item { margin: 0; background: #ffffff; border: 1px solid #eaeaea; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.02); aspect-ratio: 16 / 10; }
.tech-gallery-item img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; transition: transform 0.3s ease; }
.tech-gallery-item:hover img { transform: scale(1.04); }

/* 10. MOBILE NAVIGATION SINGLE-LINE SYMMETRY FIX */
.main-navigation a { white-space: nowrap; }

@media (max-width: 768px) {
    .header-container { flex-direction: column; align-items: center; gap: 0.5rem !important; padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
    .main-navigation { width: 100%; justify-content: center !important; flex-wrap: nowrap; gap: clamp(0.45rem, 2.5vw, 1.1rem) !important; }
    .main-navigation a { font-size: clamp(0.76rem, 3.1vw, 0.92rem) !important; padding: 0.35rem 0.15rem !important; }
    .main-navigation a.active::after { bottom: -0.4rem !important; }
}

/* 11. PRODUCT DETAIL HEADER, WEIGHT PILLS & EU NUTRITION SUB-ROWS */
.badge-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.65rem; margin-bottom: 0.5rem; }
.product-sku-inline { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.product-sku-inline code { background: #f3ece1; padding: 0.15rem 0.45rem; border-radius: 4px; color: var(--text-main); font-weight: 600; }
.product-weights-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; margin: 0.35rem 0 1.25rem 0; }
.weights-label { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); margin-right: 0.15rem; }
.weight-pill { display: inline-block; background: #fffaf0; border: 1px solid #d4af37; color: #5c4033; padding: 0.22rem 0.65rem; border-radius: 999px; font-size: 0.85rem; font-weight: 700; }
.nutritional-data-table tr.sub-nutrient td:first-child { padding-left: 1.75rem; color: var(--text-muted); font-size: 0.92rem; }
.nutritional-data-table tr.sub-nutrient td.metric-value-cell { color: var(--text-muted); font-weight: 600; }

/* 12. ADMIN CONTAINER ALIGNMENT MATCHING HEADER & CONTENT PAGES */
.admin-wrapper { width: 100% !important; max-width: 1400px !important; margin: 0 auto !important; padding-left: 1.5rem !important; padding-right: 1.5rem !important; box-sizing: border-box !important; }

/* 13. INLINE NAVBAR LANGUAGE DROPDOWN ALIGNMENT */
.gtranslate_wrapper select.gt_selector { height: 32px !important; padding: 2px 8px !important; margin: 0 !important; border-radius: 6px !important; border: 1px solid var(--color-border, #d6cbb8) !important; background: var(--color-surface, #ffffff) !important; color: var(--color-text, #3b3026) !important; font-size: 0.88rem !important; font-weight: 600 !important; cursor: pointer !important; }

/* 14. PREVENT MOBILE HEADER OVERFLOW FROM INLINE GTRANSLATE SWITCHER */
html, body { max-width: 100%; overflow-x: hidden; }

@media (max-width: 768px) {
    .header-container { flex-wrap: wrap !important; justify-content: center !important; gap: 0.5rem !important; padding: 0.65rem 0.75rem !important; }
    .main-navigation { display: flex !important; flex-wrap: wrap !important; justify-content: center !important; align-items: center !important; gap: 0.35rem 0.65rem !important; width: 100% !important; }
    .main-navigation a { font-size: 0.9rem !important; padding: 0.25rem 0.45rem !important; white-space: nowrap !important; }
    .gtranslate_wrapper { margin-left: 0 !important; }
    .gtranslate_wrapper a.gt_switcher-popup { font-size: 0.85rem !important; padding: 3px 8px !important; white-space: nowrap !important; }
}
