/* =======================================================
   ZÁKLADNÉ NASTAVENIA
======================================================= */
* { box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; margin: 0; background-color: #f4f7f6; color: #333; }

/* =======================================================
   HLAVIČKA A LOGO
======================================================= */
header { 
    background: white; padding: 15px 40px; 
    display: flex; justify-content: space-between; align-items: center; 
    border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 999; height: 110px;
}
.nav-links-left { display: flex; gap: 20px; width: 250px; }
.nav-links-left a { text-decoration: none; color: #2c3e50; font-weight: 600; font-size: 14px; text-transform: uppercase; }
.nav-links-left a:hover { color: #0277bd; }

.header-center {
    position: absolute; left: 50%; transform: translateX(-50%);
    text-align: center; display: flex; flex-direction: column; align-items: center;
}
.logo { font-size: 42px; font-weight: 800; color: #2c3e50; text-decoration: none; text-transform: uppercase; letter-spacing: 2px; }
.podnadpis { font-size: 13px; color: #7f8c8d; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 500; }

.search-box { display: flex; gap: 10px; margin-left: auto; width: 320px; justify-content: flex-end; }
.search-box input { padding: 10px 20px; border: 1px solid #ddd; border-radius: 30px; width: 100%; outline: none; }
.search-box button { background: #2c3e50; color: white; border: none; padding: 10px 15px; border-radius: 30px; cursor: pointer; font-weight: 600; }

/* =======================================================
   OBĽÚBENÉ (SRDIEČKO V HLAVIČKE)
======================================================= */
.favorites-icon { position: relative; margin-left: 15px; cursor: pointer; font-size: 22px; color: #e74c3c; }
.favorites-icon:hover { transform: scale(1.1); }
.favorites-count {
    position: absolute; top: -8px; right: -10px; background: #e74c3c; color: white;
    font-size: 11px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* =======================================================
   PANEL OBĽÚBENÝCH
======================================================= */
.favorites-panel {
    display: none; position: fixed; top: 0; right: 0; width: 400px; max-width: 100%;
    height: 100vh; background: white; box-shadow: -5px 0 30px rgba(0,0,0,0.2);
    z-index: 99999; flex-direction: column;
}
.favorites-panel.active { display: flex; }
.favorites-panel-header { padding: 20px; background: #2c3e50; color: white; display: flex; justify-content: space-between; align-items: center; }
.favorites-panel-header h3 { margin: 0; font-size: 18px; }
.favorites-panel-close { background: none; border: none; color: white; font-size: 24px; cursor: pointer; }
.favorites-panel-body { flex: 1; overflow-y: auto; padding: 15px; }
.favorites-empty { text-align: center; padding: 40px 20px; color: #999; }
.favorites-item { display: flex; gap: 15px; padding: 15px; border-bottom: 1px solid #eee; align-items: center; }
.favorites-item img { width: 70px; height: 70px; object-fit: contain; border-radius: 8px; background: #f9f9f9; }
.favorites-item-info { flex: 1; }
.favorites-item-info h4 { margin: 0 0 5px 0; font-size: 14px; color: #333; }
.favorites-item-info .price { color: #e63946; font-weight: 700; }
.favorites-item-remove { background: none; border: none; color: #e74c3c; font-size: 18px; cursor: pointer; }
.favorites-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 99998;
}
.favorites-overlay.active { display: block; }

/* =======================================================
   NAVIGÁCIA A KATEGÓRIE
======================================================= */
nav { 
    background: #e3f2fd; padding: 15px 0; text-align: center; 
    display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; 
    position: relative; z-index: 100;
}
.nav-item { position: relative; display: inline-block; }
nav a.kat-btn { 
    padding: 10px 20px; color: #333; text-decoration: none; font-size: 15px; font-weight: 500; 
    border-radius: 25px; background: white; transition: 0.2s; display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
nav a.kat-btn:hover { color: #0277bd; transform: translateY(-2px); }
nav a.kat-btn.aktivna { background: #0277bd; color: white; }
nav a.kat-btn i { font-size: 16px; color: inherit; }
.sipka { border: solid currentColor; border-width: 0 2px 2px 0; display: inline-block; padding: 2px; transform: rotate(45deg); margin-bottom: 2px; margin-left: 2px; }
.dropdown {
    display: none; position: absolute; background-color: white; min-width: 200px;
    box-shadow: 0px 10px 30px rgba(0,0,0,0.15); border-radius: 12px;
    padding: 15px 0; top: 100%; left: 0; text-align: left; z-index: 9999;
}
.dropdown a { color: #333; padding: 10px 20px; text-decoration: none; display: block; font-size: 14px; border-radius: 0; background: transparent; transition: 0.2s; }
.dropdown a:hover { background-color: #f1f1f1; color: #0277bd; padding-left: 25px; }
.nav-item:hover .dropdown { display: block; }

/* =======================================================
   LAYOUT KATALÓGU A FILTRE
======================================================= */
.layout-container { display: flex; max-width: 1400px; margin: 40px auto; padding: 0 20px; gap: 30px; align-items: flex-start; }
.sidebar { width: 280px; flex-shrink: 0; background: white; padding: 25px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 130px; max-height: calc(100vh - 240px); overflow-y: auto; }
.filter-group { margin-bottom: 25px; border-bottom: 1px solid #f0f0f0; padding-bottom: 20px; }
.filter-group h4 { margin: 0 0 15px 0; font-size: 16px; color: #2c3e50; }
.price-inputs { display: flex; gap: 10px; align-items: center; }
.price-inputs input { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 6px; }
.brand-search { width: 100%; padding: 8px; margin-bottom: 10px; border: 1px solid #ddd; border-radius: 6px; }
.brand-list { max-height: 250px; overflow-y: auto; }
.brand-item { display: flex; align-items: center; margin-bottom: 6px; font-size: 14px; cursor: pointer; }
.btn-submit { width: 100%; background: #27ae60; color: white; padding: 12px; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn-reset { display: block; text-align: center; margin-top: 15px; color: #7f8c8d; text-decoration: none; font-size: 14px; padding: 10px; border: 1px solid #e0e0e0; border-radius: 8px; }

/* =======================================================
   PRODUKTOVÁ MRIEŽKA A KARTY
======================================================= */
.main-content { flex-grow: 1; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.karta { background: white; border-radius: 12px; overflow: hidden; border: 1px solid #f0f0f0; transition: 0.3s; display: flex; flex-direction: column; position: relative; }
.karta:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.foto-obal { height: 250px; padding: 20px; display: flex; align-items: center; justify-content: center; }
.foto-obal img { 
    max-width: 100%; max-height: 100%; object-fit: contain; 
    transform: translateZ(0); will-change: transform; aspect-ratio: 1 / 1; 
}
.info { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.nazov { font-size: 17px; font-weight: 600; color: #222; height: 50px; overflow: hidden; margin-top: 10px; }
.cena { font-size: 22px; color: #e63946; font-weight: 700; }
.btn-kupit { 
    background: transparent; color: #27ae60; text-decoration: none; padding: 6px 15px; 
    border: 2px solid #27ae60; border-radius: 8px; font-size: 14px; font-weight: 700; text-align: center; transition: 0.3s;
}
.btn-kupit:hover { background: #27ae60; color: white; }
.spodok-karty { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 15px; border-top: 1px solid #f5f5f5; }

/* SRDIEČKO NA KARTE */
.favorite-btn {
    position: absolute; top: 15px; right: 15px; background: white; border: none; width: 36px; height: 36px;
    border-radius: 50%; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex; align-items: center; justify-content: center; transition: 0.2s; z-index: 10;
}
.favorite-btn:hover { transform: scale(1.1); }
.favorite-btn i { font-size: 18px; color: #ccc; transition: 0.2s; }
.favorite-btn.active i { color: #e74c3c; }

/* STRÁNKOVANIE A PÄTIČKA */
.strankovanie { text-align: center; margin: 40px 0; }
.strankovanie a { display: inline-block; padding: 10px 18px; margin: 0 4px; border: 1px solid #ddd; color: #333; text-decoration: none; border-radius: 8px; }
.strankovanie a.aktualna { background: #2c3e50; color: white; border-color: #2c3e50; }
footer { background: #1e293b; color: #cbd5e1; padding: 40px 20px; text-align: center; margin-top: 60px; }
footer .copy { color: white; font-weight: 600; display: block; margin-bottom: 10px; }
footer p { margin: 5px 0; font-size: 14px; line-height: 1.6; }

/* =======================================================
   MOBILNÉ ZOBRAZENIE
======================================================= */
.mobile-filter-btn { display: none; }
.btn-close-sidebar { display: none; }

@media (max-width: 1000px) {
    header { height: auto; flex-direction: column; padding: 20px; }
    .nav-links-left { width: 100%; justify-content: center; margin-bottom: 10px; }
    .header-center { position: static; transform: none; }
    .search-box { width: 100%; margin-top: 15px; }
    .layout-container { flex-direction: column; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .favorites-panel { width: 100%; }
    
    .mobile-filter-container {
        position: sticky; top: 215px; z-index: 90; background: #f4f7f6; padding: 10px 20px; margin: 0;
    }
    .mobile-filter-btn { 
        display: block; width: 100%; padding: 12px; background: #2c3e50; color: white; 
        border: none; border-radius: 8px; font-weight: 600; font-size: 16px; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    
    .sidebar { 
        display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; 
        z-index: 99999; padding-top: 20px; overflow-y: auto; max-height: none; 
    }
    .sidebar.active { display: block; }
    #filterForm { padding-bottom: 80px; }
    .brand-list { max-height: 150px; }
    .btn-close-sidebar { display: block; width: 100%; background: #e74c3c; color: white; padding: 10px; border: none; border-radius: 8px; margin-bottom: 20px; font-weight: 600; cursor: pointer; }
}