/* ============================================================
   PROIZVODI.CSS — Product Catalog Page Styles
   Inherits design tokens from style.css
   ============================================================ */

/* ---------- PAGE LAYOUT ---------- */
.catalog-page {
    display: flex;
    gap: var(--space-8);
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
    align-items: flex-start;
}

/* ---------- CATALOG HERO BAND ---------- */
.catalog-hero {
    background-image: linear-gradient(to bottom, rgba(69, 26, 3, 0.7), rgba(69, 26, 3, 0.5)), url("pcelinjidarovi.jpg");
    background-size: cover;
    background-position: center;
    padding: var(--space-24) 0 var(--space-16);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.catalog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    pointer-events: none;
}

.catalog-hero-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: var(--space-4);
    position: relative;
}

.catalog-hero-sub {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.75);
    max-width: 520px;
    margin: 0 auto var(--space-8);
    position: relative;
}

/* ---------- SEARCH BAR ---------- */
.search-wrapper {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: var(--space-4) var(--space-4) var(--space-4) 52px;
    border-radius: var(--radius-full);
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    color: var(--color-white);
    font-size: var(--text-base);
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.search-input:focus {
    border-color: var(--color-amber-300);
    background: rgba(255, 255, 255, 0.18);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

/* ---------- MOBILE FILTER STRIP ---------- */
.mobile-filter-strip {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding: var(--space-4) var(--space-4);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.mobile-filter-strip::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    flex-shrink: 0;
    padding: 6px 18px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-border);
    background: transparent;
    color: var(--color-text-light);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

/* ---------- SIDEBAR ---------- */
.catalog-sidebar {
    display: none;
    /* Hidden on mobile */
    flex-direction: column;
    gap: var(--space-2);
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

.sidebar-heading {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-amber-900);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--color-amber-200);
    margin-bottom: var(--space-2);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-light);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    width: 100%;
    text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--color-honey-100);
    color: var(--color-amber-800);
    font-weight: 700;
}

.sidebar-link .sidebar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-amber-400);
    flex-shrink: 0;
}

/* ---------- MAIN CONTENT ---------- */
.catalog-main {
    flex: 1;
    min-width: 0;
}

.no-results {
    display: none;
    text-align: center;
    padding: var(--space-16);
    color: var(--color-text-light);
}

.no-results.visible {
    display: block;
}

/* ---------- CATEGORY SECTION ---------- */
.category-section {
    margin-bottom: var(--space-16);
}

.category-section.hidden {
    display: none;
}

.category-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--color-amber-200);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--color-honey-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.category-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-amber-900);
}

.category-count {
    margin-left: auto;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ---------- PRODUCT GRID ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}

/* ---------- PRODUCT CARD ---------- */
.product-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(217, 119, 6, 0.12);
}

/* Badge row (Bio / Ručni rad / Novo) */
.card-badges {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    display: flex;
    gap: var(--space-1);
    flex-wrap: wrap;
    z-index: 2;
}

.badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.badge-bio {
    background: #dcfce7;
    color: #166534;
}

.badge-rucni {
    background: var(--color-honey-100);
    color: var(--color-amber-800);
}

.badge-novo {
    background: #fce7f3;
    color: #9d174d;
}

/* Image area */
.card-image-wrapper {
    aspect-ratio: 1 / 1;
    background: var(--color-honey-50);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s;
}

.product-card:hover .card-image {
    transform: scale(1.05);
}

.card-image-placeholder {
    font-size: 56px;
    line-height: 1;
    opacity: 0.5;
}

/* Card body */
.card-body {
    padding: var(--space-4);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.card-name {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-amber-900);
    line-height: 1.3;
}

.card-desc {
    font-size: var(--text-xs);
    color: var(--color-text-light);
    line-height: 1.5;
}

.card-desc-full {
    display: none;
}

.card-desc-full.open {
    display: block;
}

.toggle-desc {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

/* Weight / Price Selector */
.weight-selector {
    display: flex;
    gap: var(--space-1);
    flex-wrap: wrap;
    margin-top: var(--space-1);
}

.weight-option {
    display: none;
    /* Hide the radio */
}

.weight-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-light);
    transition: all 0.15s;
    line-height: 1.3;
}

.weight-label .wt-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary);
}

.weight-option:checked+.weight-label {
    border-color: var(--color-primary);
    background: var(--color-honey-50);
    color: var(--color-amber-800);
}

/* Price display */
.card-price {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-primary);
    margin-top: auto;
}

.card-price .price-unit {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-weight: 400;
}

/* Card Footer / CTA buttons */
.card-footer {
    padding: 0 var(--space-4) var(--space-4);
    display: flex;
    gap: var(--space-2);
}

.btn-cart,
.btn-call {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
}

.btn-cart {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-cart:hover,
.btn-cart.added {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-call {
    background: var(--color-amber-900);
    color: var(--color-white);
    border: none;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(69, 26, 3, 0.2);
}

.btn-call:hover {
    background: #2c1102;
    /* Even darker amber */
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(69, 26, 3, 0.3);
}

.btn-call svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ========== CART DRAWER ========== */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: min(420px, 100vw);
    height: 100vh;
    background: var(--color-white);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer.open {
    right: 0;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.cart-drawer-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-amber-900);
}

.cart-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.cart-close-btn:hover {
    background: var(--color-gray-100);
}

.cart-close-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cart-empty {
    text-align: center;
    padding: var(--space-16) var(--space-6);
    color: var(--color-text-light);
}

.cart-empty-icon {
    font-size: 56px;
    margin-bottom: var(--space-4);
}

.cart-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    background: var(--color-honey-50);
    border: 1px solid var(--color-honey-100);
    align-items: center;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: var(--color-white);
    flex-shrink: 0;
    padding: 4px;
}

.cart-item-emoji {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    background: var(--color-white);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

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

.cart-item-name {
    font-weight: 700;
    color: var(--color-amber-900);
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-variant {
    font-size: var(--text-xs);
    color: var(--color-text-light);
}

.cart-item-price {
    font-weight: 700;
    color: var(--color-primary);
    font-size: var(--text-sm);
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    background: var(--color-white);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
}

.qty-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.qty-count {
    font-weight: 700;
    font-size: var(--text-sm);
    min-width: 20px;
    text-align: center;
}

.cart-footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-total-label {
    font-size: var(--text-base);
    color: var(--color-text-light);
}

.cart-total-amount {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-amber-900);
}

.cart-shipping-note {
    font-size: var(--text-xs);
    color: #22c55e;
    text-align: center;
    font-weight: 600;
}

.btn-order-call {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-amber-900);
    color: var(--color-white);
    font-size: var(--text-base);
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    width: 100%;
}

.btn-order-call:hover {
    background: var(--color-amber-700);
    transform: translateY(-2px);
}

.btn-order-call svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.btn-clear-cart {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    cursor: pointer;
    text-align: center;
    text-decoration: underline;
    padding: 0;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .mobile-filter-strip {
        display: none;
    }

    .catalog-sidebar {
        display: flex;
    }

    .catalog-page {
        padding: var(--space-10) var(--space-8);
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
