/* =========================================
   CATALOG.CSS - ПРЕМИУМ ДИЗАЙН 
   ========================================= */

:root {
    --color-primary: #008B8B;   
    --color-secondary: #9370DB; 
    --color-accent: #D2691E;    
    --color-text: #37474F;
    --color-bg: #F9F9F9;
}

/* =========================================
   НОВ КРЕАТИВЕН БАНЕР (HERO SECTION)
   ========================================= */
.creative-hero {
    position: relative;
    padding: 60px 20px;
    margin-bottom: 40px;
    background: #fdfbff; /* Светъл, чист фон */
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 139, 139, 0.05);
}

.hero-glass-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Плаващи цветни петна (Blobs) */
.hero-shapes {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: var(--color-primary);
    top: -100px;
    left: 10%;
}

.blob-2 {
    width: 250px;
    height: 250px;
    background: var(--color-secondary);
    bottom: -50px;
    right: 10%;
    animation-delay: -5s;
}

@keyframes float {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(30px, 20px) scale(1.1); }
}

.hero-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(147, 112, 219, 0.1);
    color: var(--color-secondary);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    border-radius: 30px;
    margin-bottom: 15px;
}

.hero-inner-content h1 {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    color: #1a2b3c;
    margin-bottom: 15px;
    line-height: 1.1;
}

.hero-inner-content p {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Респонсив за банера */
@media (max-width: 768px) {
    .hero-inner-content h1 { font-size: 2.2rem; }
    .hero-inner-content p { font-size: 1rem; }
    .creative-hero { padding: 40px 20px; }
}

.catalog-page { padding-bottom: 80px; }

.catalog-container { 
    display: flex; gap: 40px; align-items: flex-start; 
    max-width: 1500px; 
    margin: 0 auto; padding: 0 20px;
}

.catalog-sidebar {
    width: 320px; flex-shrink: 0;
    background: white; border-radius: 12px; padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}

.sidebar-title { 
    font-size: 1.1rem; font-family: var(--font-body); font-weight: 800; 
    margin-bottom: 20px; color: var(--color-text); text-transform: uppercase; letter-spacing: 1px;
}
.sidebar-divider { border: 0; height: 1px; background: #eee; margin: 25px 0; }

.cat-menu, .sub-menu { list-style: none; padding: 0; margin: 0; }
.sub-menu { padding-left: 15px; display: none; margin-top: 5px; margin-bottom: 10px; border-left: 2px solid #f0f0f0;}
.sub-menu.open { display: block; }
.cat-item { margin-bottom: 5px; }

.cat-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; border-radius: 16px; border: 1px solid transparent;
    transition: 0.2s; color: #555; text-decoration: none; 
}
.cat-row:hover { background: #f0fdfd; color: var(--color-primary); border-radius: none;} 
.cat-row.active { background: #f0fdfd; color: var(--color-primary); border-color: #d1f2f2; font-weight: 700;}
.cat-row.active .cat-count-val { color: var(--color-primary); font-weight: bold;}

.hidden-cb { display: none; }
.cat-label-wrap { cursor: pointer; flex-grow: 1; display: flex; align-items: center; margin: 0; padding: 4px 0; word-break: break-word;}
.cat-text { font-size: 0.95rem; }

.cat-actions-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-shrink: 0; width: 65px;}

.toggle-sub-btn {
    background: transparent; border: none; outline: none; cursor: pointer;
    color: #aaa; width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; transition: all 0.3s ease; padding: 0; margin: 0;
    position: relative; z-index: 10;
}
.toggle-sub-btn:hover { background: #e8f5f5; color: var(--color-primary); transform: scale(1.1); }
.toggle-sub-btn .arrow-icon { transition: transform 0.3s ease; pointer-events: none;}
.toggle-sub-btn.open .arrow-icon { transform: rotate(90deg); color: var(--color-accent); } 

.empty-arrow { width: 24px; display: inline-block; }
.cat-count-val { font-weight: normal; font-size: 0.85rem; color: #aaa; text-align: right; width: 30px; display: inline-block;}

.reset-link { display: flex; text-decoration: none; color: #555; width: 100%; justify-content: space-between;}
.reset-link:hover { color: var(--color-primary); }

.ozone-price-container { margin-top: 10px; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
.ozone-inputs { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.input-wrap { display: flex; align-items: center; border: 1px solid #ddd; border-radius: 6px; padding: 6px 10px; background: white; flex: 1; }
.input-wrap input { width: 100%; border: none; outline: none; font-family: var(--font-body); font-weight: 600; color: #333; text-align: center;}
.input-wrap:focus-within { border-color: var(--color-secondary); box-shadow: 0 0 5px rgba(147, 112, 219, 0.2);} 
.input-wrap span { color: #888; font-weight: 600; font-size: 0.9rem;}
.range-slider { position: relative; width: 100%; height: 6px; background: #f5ebd7; border-radius: 5px; }
.slider-track { position: absolute; height: 100%; background: var(--color-secondary); border-radius: 5px; z-index: 1;}
.range-slider input[type="range"] { position: absolute; width: 100%; height: 6px; top: 0; left: 0; -webkit-appearance: none; appearance: none; background: transparent; pointer-events: none; z-index: 2; margin: 0; outline: none;}
.range-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: all; width: 20px; height: 20px; border-radius: 50%; background: white; border: 4px solid var(--color-primary); cursor: grab; box-shadow: 0 2px 5px rgba(0,0,0,0.3); transition: transform 0.1s; position: relative; z-index: 3;}
.range-slider input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.2); }
.range-slider input[type="range"]::-moz-range-thumb { pointer-events: all; width: 12px; height: 12px; border-radius: 50%; background: #d6b8fc; border: 4px solid var(--color-secondary); cursor: grab; box-shadow: 0 2px 5px rgba(0,0,0,0.3); transition: transform 0.1s; position: relative; z-index: 3;}
.range-slider input[type="range"]::-moz-range-thumb:active { cursor: grabbing; transform: scale(1.2); }

.catalog-main { flex: 1; min-width: 0; }

.top-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: white; padding: 15px 25px; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 25px; flex-wrap: wrap; gap: 15px;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.tb-label { font-weight: 700; font-size: 0.95rem; color: var(--color-text); }

.search-box { 
    display: flex; border: 2px solid #eee; border-radius: 30px; overflow: hidden; 
    background: #fafafa; transition: 0.3s ease;
}
.search-box:focus-within { border-color: var(--color-secondary); background: #fff; box-shadow: 0 0 10px rgba(147, 112, 219, 0.15); }
.search-box input { border: none; padding: 8px 15px; outline: none; width: 220px; font-family: var(--font-body); background: transparent;}
.search-box button { border: none; background: transparent; color: var(--color-primary); padding: 0 15px; cursor: pointer; transition: 0.2s;}
.search-box button:hover { color: var(--color-secondary); transform: scale(1.1); }

.tb-results { font-size: 0.9rem; color: #888; margin-left: 5px; }
.tb-control { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: #555; }
.custom-select { 
    padding: 8px 30px 8px 15px; border: 1px solid #ddd; border-radius: 30px; outline: none; cursor: pointer; 
    font-family: var(--font-body); background: white url('data:image/svg+xml;utf8,<svg viewBox="0 0 10 6" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L5 5L9 1" stroke="%23555" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 12px center;
    background-size: 10px; appearance: none; -webkit-appearance: none; transition: 0.3s;
}
.custom-select:hover { border-color: var(--color-secondary); }

.active-filters-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; align-items: center;}
.filter-pill {
    background: white; border: 1px solid var(--color-primary); color: var(--color-primary);
    padding: 6px 15px; border-radius: 30px; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; font-weight: 600; box-shadow: 0 2px 5px rgba(0,139,139,0.1);
}
.filter-pill i { cursor: pointer; opacity: 0.7; transition: 0.2s;}
.filter-pill i:hover { opacity: 1; color: #e74c3c; transform: scale(1.2);}

.filter-clear-all { 
    color: #e74c3c; border: 1px solid #e74c3c; padding: 6px 15px; border-radius: 30px; 
    font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; gap: 8px; 
    font-weight: 600; background: white; transition: 0.3s;
}
.filter-clear-all:hover { background: #e74c3c; color: white; box-shadow: 0 4px 10px rgba(231, 76, 60, 0.2); }

/* --- ПРОДУКТОВИ КАРТИ (⚠️ ПЕРФЕКТНА 3:4 РАМКА С PADDING) --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 35px;
}

.product-card {
    background: white; border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex; flex-direction: column; border: 1px solid #f5f5f5;
    height: 100%;
}
.product-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 15px 35px rgba(147, 112, 219, 0.15); 
    border-color: #eee;
}

.card-img-box { 
    width: 100%; 
    aspect-ratio: 3 / 4; 
    flex-shrink: 0; 
    padding: 12px; 
    background: #ffffff; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    border-bottom: 1px solid #f5f5f5; 
    box-sizing: border-box; 
}

.card-img-box a {
    display: flex; 
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    border-radius: 8px; 
    overflow: hidden; 
    background: #fdfdfd; 
}

.card-img-box img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s ease; 
}
.product-card:hover .card-img-box img { transform: scale(1.08); }

.card-info-box { padding: 20px 20px 25px 20px; display: flex; flex-direction: column; flex-grow: 1; text-align: center; }

.card-category { font-size: 0.75rem; color: #a5a1b5; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 1px; display: block; flex-shrink: 0; line-height: 1.2;}
.card-title { font-size: 1.2rem; color: var(--color-text); margin-bottom: 15px; display: block; flex-shrink: 0; line-height: 1.4; font-weight: 700;}
.card-title a { color: inherit; text-decoration: none; transition: 0.2s;}
.card-title a:hover { color: var(--color-secondary); }

.card-prices { margin-bottom: 25px; margin-top: auto; flex-shrink: 0; }
.price-main { font-size: 1.7rem; font-weight: 800; color: var(--color-primary); display: block; line-height: 1; margin-bottom: 5px;}
.price-sub { font-size: 0.95rem; color: #888; display: block; text-decoration: none !important; line-height: 1;}

.card-actions { display: flex; gap: 10px; align-items: stretch; justify-content: center; flex-shrink: 0;}
.btn-card-primary {
    flex: 1; background: var(--color-primary); color: white; padding: 13px 10px; 
    border-radius: 30px; font-weight: 700; font-size: 0.85rem; text-decoration: none; transition: 0.3s; display: flex; align-items: center; justify-content: center;
}
.btn-card-primary:hover { background: #007373; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 139, 139, 0.3);}

.btn-card-icon {
    width: 46px; height: 46px; border-radius: 50%; border: none; background: #f0fdfd;
    color: var(--color-primary); font-size: 1.1rem; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-card-icon:hover { background: var(--color-secondary); color: white; transform: scale(1.1); box-shadow: 0 4px 10px rgba(147, 112, 219, 0.3);}

.empty-state { 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 80px 20px; grid-column: 1 / -1;
    background: white; border-radius: 12px; border: 2px dashed #e0dcf0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}
.empty-state i { font-size: 4.5rem; color: var(--color-secondary); opacity: 0.4; margin-bottom: 20px;}
.empty-state h2 { color: var(--color-text); margin-bottom: 10px; font-family: var(--font-heading);}
.empty-state p { color: #888; margin-bottom: 25px;}
.empty-state .btn-card-primary { cursor: pointer; } 

.pagination-box { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 60px; }
.page-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid #e0e0e0; background: white;
    display: flex; align-items: center; justify-content: center; color: #555; 
    transition: all 0.3s ease; font-weight: 700; text-decoration: none; font-size: 1.05rem;
}
.page-btn.active { 
    background: var(--color-primary); color: white; border-color: var(--color-primary); 
    box-shadow: 0 4px 10px rgba(0,139,139,0.25);
}
.page-btn:hover:not(.active) { 
    border-color: var(--color-primary); color: var(--color-primary); 
    transform: translateY(-2px);
}
.page-btn i { font-size: 0.9rem; }

/* --- МОДАЛ БЪРЗ ПРЕГЛЕД (⚠️ ИЗЧИСТЕН И ПОДРЕДЕН) --- */
.modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(4px);}
.modal-backdrop.active { opacity: 1; visibility: visible; }

.modal-box { 
    background: white; border-radius: 12px; width: 90%; 
    max-width: 850px; /* Увеличено от 850px */
    height: 550px; /* Увеличено от 520px */
    position: relative; transform: scale(0.95); transition: 0.3s; box-shadow: 0 15px 50px rgba(0,0,0,0.3); overflow: hidden;
}
.modal-backdrop.active .modal-box { transform: scale(1); }
.modal-close { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; color: #999; cursor: pointer; z-index: 10; transition: 0.3s;}
.modal-close:hover { color: var(--color-accent); transform: rotate(90deg); }

.modal-split { display: flex; flex-wrap: nowrap; height: 100%; width: 100%; } 

/* ЗУУМ КУТИЯТА ВЛЯВО */
.modal-left { 
    width: 45%; 
    padding: 0; 
    background: #fdfdfd; 
    border-right: 1px solid #eee; 
    position: relative;
    overflow: hidden; 
    cursor: crosshair; 
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    mask-image: radial-gradient(white, black);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}
.modal-left img { 
    width: 100%; height: 100%; 
    object-fit: cover; 
    display: block;
    transform-origin: center center;
    transition: transform 0.1s ease-out; 
}
.modal-left img[src=""], .modal-left img:not([src]) { opacity: 0; }

/* ДЯСНА ЧАСТ */
.modal-right { 
    width: 55%; 
    padding: 35px 40px 90px 40px; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
    text-align: left; 
    height: 100%;
    position: relative; 
}

/* КАТЕГОРИЯТА */
.modal-cat { 
    font-size: 0.85rem; 
    color: var(--color-secondary); 
    margin-bottom: 5px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    font-weight: 800;
    border: none; 
    padding: 0;
}

/* ИМЕТО */
.modal-title { 
    font-family: var(--font-heading); 
    font-size: 2rem; 
    margin-bottom: 15px; 
    color: var(--color-text); 
    padding-bottom: 15px; 
    border-bottom: 2px solid #eee; 
    width: 100%;
    line-height: 1.2;
}

/* ЗВЕЗДИ */
.modal-rating { display: flex; align-items: center; margin-bottom: 20px; }
.stars-outer { display: inline-block; position: relative; font-family: "Font Awesome 5 Free"; font-weight: 900; color: #eee; font-size: 1.1rem; }
.stars-outer::before { content: "\f005 \f005 \f005 \f005 \f005"; }
.stars-inner { position: absolute; top: 0; left: 0; white-space: nowrap; overflow: hidden; color: #ffbb00; }
.stars-inner::before { content: "\f005 \f005 \f005 \f005 \f005"; }
.qv-reviews-text { font-size: 0.85rem; color: #888; margin-left: 8px; }

/* ЦЕНА */
.modal-price-box { margin-bottom: 20px; padding: 15px 25px; background: #fafafa; border-radius: 12px; border: 1px dashed #ddd; width: 100%; max-width: 250px;}
.modal-price-eur { font-size: 2.2rem; font-weight: 800; color: var(--color-primary); display: block; line-height: 1;}
.modal-price-bgn { font-size: 1rem; color: #888; display: block; margin-top: 5px; text-decoration: none !important;}

/* ОПИСАНИЕ */
.modal-desc { 
    font-size: 0.95rem; color: #666; margin-bottom: 20px; line-height: 1.5; 
    width: 100%;
    /* Махаме изрязването на 4 реда и слагаме умен скрол */
    max-height: 140px; 
    overflow-y: auto; 
    padding-right: 10px; /* Място за скролбара */
}

/* Красив, тънък скролбар само за описанието */
.modal-desc::-webkit-scrollbar { width: 4px; }
.modal-desc::-webkit-scrollbar-track { background: #f9f9f9; border-radius: 4px; }
.modal-desc::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.modal-desc::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* БУТОН */
.modal-action-btn { 
    position: absolute; 
    bottom: 30px; left: 40px; right: 40px; 
    padding: 15px; font-size: 1.05rem; text-align: center; margin: 0; transition: 0.3s;
}
.modal-action-btn:hover { background: #007373; box-shadow: 0 5px 15px rgba(0, 139, 139, 0.3); transform: translateY(-2px);}

.page-dots {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 5px;
    color: var(--text-color);
    font-weight: 600;
    letter-spacing: 2px;
}
/* --- РЕСПОНСИВ (ТАБЛЕТИ И СМАРТФОНИ) --- */
@media (max-width: 900px) and (min-width: 600px) {
    /* ТАБЛЕТИ (Една колона продукти, но запазваме модала на два реда със скрол) */
    .catalog-container { flex-direction: row; gap: 20px; }
    .catalog-sidebar { width: 260px; padding: 20px; }
    .products-grid { grid-template-columns: 1fr; } 
    
    .modal-box { 
        height: auto; max-height: 90vh; overflow-y: auto; display: block;
    }
    .modal-split { 
        flex-direction: row; align-items: flex-start; height: auto;
    }
    /* Снимката става "лепкава", докато скролваш текста вдясно! */
    .modal-left { 
        width: 45%; height: auto; aspect-ratio: 3 / 4; position: sticky; top: 0; border-right: 1px solid #eee; border-bottom: none;
    }
    .modal-right { 
        width: 55%; height: auto; padding: 30px 25px 90px 25px; 
    }
    .modal-desc { -webkit-line-clamp: unset; } /* Показва целия текст */
    .modal-action-btn { left: 25px; right: 25px; bottom: 25px; }
}

@media (max-width: 599px) {
    /* СМАРТФОНИ */
    .catalog-container { flex-direction: column; }
    .catalog-sidebar { width: 100%; margin-bottom: 30px; }
    .top-bar { flex-direction: column; align-items: flex-start; }
    .tb-right { width: 100%; justify-content: space-between; }
    
    .modal-box { height: auto; max-height: 90vh; overflow-y: auto; display: block; }
    .modal-split { flex-direction: column; height: auto; }
    .modal-left { border-right: none; border-bottom: 1px solid #eee; width: 100%; height: auto; aspect-ratio: 3 / 4;}
    .modal-right { width: 100%; padding: 25px 20px 90px 20px; height: auto; }
    .modal-desc { -webkit-line-clamp: unset; }
    .modal-action-btn { left: 20px; right: 20px; bottom: 20px;}
}