*, body, input, select, textarea, button {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --green-primary:  #648E37;
    --green-hover:    #527230;
    --green-dark:     #303823;
    --green-mid:      #504d2c;
    --green-light:    #eef4e6;
    --green-accent:   #8fba52;
    --border-light:   #e4e8df;
}


/* HERO */
.catalog-hero {
    background: #1a1f14;
    padding: 140px 0 80px;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
}

.catalog-hero-bg {
    position: absolute;
    inset: -20px;
    background: url('../assets/images/cover.webp') center/cover no-repeat;
    filter: blur(14px);
    opacity: 0.55;
    transform: scale(1.05);
    z-index: 0;
}

.catalog-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        160deg,
        rgba(15, 20, 10, 0.70) 0%,
        rgba(30, 38, 20, 0.55) 50%,
        rgba(15, 20, 10, 0.72) 100%
    );
}

.catalog-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* Hero logo */
.catalog-hero-logo {
    margin-bottom: 20px;
}

.catalog-hero-logo-img {
    height: 64px;
    width: auto;
    opacity: 0.92;
    filter: brightness(0) invert(1);
}

/* Title */
.catalog-hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin: 0 0 16px;
}

.catalog-hero-accent {
    color: var(--green-accent);
}

.catalog-hero-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.75);
    font-weight: 400;
    margin: 0 0 32px;
    line-height: 1.7;
}

/* Hero action buttons */
.catalog-hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.catalog-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.2);
    color: #fff;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    position: relative;
}

.catalog-toolbar-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.75);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(100,142,55,0.3);
}

.catalog-toolbar-btn[aria-expanded="true"] {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.75);
}

.catalog-toolbar-btn--calc {
    background: var(--green-primary);
    border-color: var(--green-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(100,142,55,0.3);
}

.catalog-toolbar-btn--calc:hover {
    background: var(--green-hover);
    border-color: var(--green-hover);
    box-shadow: 0 4px 14px rgba(100,142,55,0.35);
}

/* Chevron rotation on open */
.filter-chevron {
    transition: transform 0.28s ease;
    flex-shrink: 0;
}

.catalog-toolbar-btn[aria-expanded="true"] .filter-chevron {
    transform: rotate(180deg);
}

/* Active filter indicator dot */
.filter-active-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ffcc44;
    flex-shrink: 0;
}

/* ===============================
   FILTER PANEL (collapsible below hero)
   =============================== */
.filter-panel {
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    opacity: 0;
}

.filter-panel.filter-panel--open {
    max-height: 400px;
    opacity: 1;
}

.filter-panel-inner {
    padding: 20px 0;
}

/* Panel header: title + reset side by side */
.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.filter-panel-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-panel-title svg { color: var(--green-dark); }

.filter-panel-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.filter-panel-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 160px;
    min-width: 130px;
}

.filter-field-search { flex: 2 1 240px; }

.filter-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--green-dark);
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-search-wrap {
    position: relative;
}

.filter-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

.filter-input,
.filter-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    background: white;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.filter-input { padding-left: 34px; }

.filter-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(100,142,55,0.15);
}

/* Reset button — top-right of panel header */
.filter-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    border: 2px solid #e8e8e8;
    background: white;
    color: #555;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-reset-btn:hover {
    border-color: var(--green-dark);
    background: var(--green-light);
    color: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(100,142,55,0.15);
}

/* ===============================
   RESULTS BAR
   =============================== */
.catalog-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.catalog-results-count {
    margin: 0;
    font-size: 0.9rem;
    color: #888;
}

.catalog-results-count strong {
    color: var(--green-dark);
    font-weight: 700;
}

/* ===============================
   CALCULATOR MODAL
   =============================== */
.calc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.28s ease;
    backdrop-filter: blur(3px);
}

.calc-modal-backdrop.calc-modal--visible {
    opacity: 1;
}

.calc-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.calc-modal-backdrop.calc-modal--visible .calc-modal {
    transform: translateY(0) scale(1);
}

.calc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    z-index: 1;
}

.calc-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--green-dark);
}

.calc-modal-title svg { color: var(--green-dark); }

.calc-modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}

.calc-modal-close:hover { background: #eee; color: #333; }

.calc-modal-body {
    padding: 22px 24px 24px;
}

.calc-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.calc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.calc-field-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.calc-input,
.calc-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1.5px solid #dcdcdc;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.calc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.calc-input:focus,
.calc-select:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(100,142,55,0.15);
}

.calc-input:disabled,
.calc-select:disabled {
    background: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

.calc-modal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
}

.calc-btn-calculate {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    border-radius: 8px;
    border: none;
    background: var(--green-dark);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s;
}

.calc-btn-calculate:hover {
    background: var(--green-hover);
    transform: translateY(-1px);
}

.calc-btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1.5px solid var(--border-light);
    background: #fafafa;
    color: #666;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.calc-btn-reset:hover {
    border-color: var(--green-dark);
    color: var(--green-dark);
    background: var(--green-light);
}

body.calc-modal-open { overflow: hidden; }

.text-success { color: var(--green-dark) !important; }

/* ===============================
   FILTER SECTION (keep for estimation-section compatibility)
   =============================== */
.filter-section {
    background: #ffffff;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid var(--border-light);
}

.filter-section .form-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-section .form-control,
.filter-section .form-control-lg,
.filter-section .form-select,
.filter-section .form-select-lg {
    font-size: 0.85rem;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1.5px solid #dcdcdc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-section .form-control:focus,
.filter-section .form-select:focus {
    border-color: var(--green-dark);
    box-shadow: 0 0 0 0.15rem rgba(100, 142, 55, 0.18);
}

.filter-section .btn,
.filter-section .btn-lg {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 6px;
}


/* ===============================
   PRODUCT CARD
   =============================== */
.product-catalog-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(100,142,55,0.18);
    border-color: var(--green-dark);
}

.product-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hover-text {
    color: #2d2d2d;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

.hover-icon { display: none; }

.product-catalog-card:hover .product-hover-overlay { opacity: 1; }

.product-image-wrapper {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: #f8f8f8;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.product-catalog-card:hover .product-image { transform: scale(1.04); }

.placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #999;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(100, 142, 55, 0.95);
    color: #fff;
    padding: 4px 12px;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    backdrop-filter: blur(10px);
    z-index: 5;
    box-shadow: 0 2px 8px rgba(100,142,55,0.3);
}

/* ===============================
   PRODUCT INFO
   =============================== */
.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    background: white;
    height: auto;
}

.product-header-section { margin-bottom: 2px; }

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green-dark);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.08rem;
    max-height: 3.08rem;
}

.product-description {
    font-size: 0.88rem;
    color: #8B7355;
    font-weight: 500;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    min-height: 4.2rem;
    max-height: 4.2rem;
}

.product-sizes, .product-colors, .product-pricing,
.price-row, .price-label, .price-value { display: none !important; }

.view-details-btn, .inquiry-btn { display: none !important; }

/* ===============================
   CTA
   =============================== */
.cta-section {
    background: linear-gradient(135deg, rgba(100,142,55,0.05), rgba(84,117,41,0.05));
}

.btn-choose-branch {
    background: var(--green-dark) !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    padding: 14px 40px !important;
    border-radius: 50px !important;
    border: 2px solid var(--green-dark) !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 20px rgba(48,56,35,0.35) !important;
    letter-spacing: 0.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.btn-choose-branch:hover {
    background: transparent !important;
    color: var(--green-dark) !important;
    border-color: var(--green-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(48,56,35,0.18) !important;
}

/* ===============================
   GRID LAYOUT
   =============================== */
#productsGrid .col-lg-3,
#productsGrid .col-md-4,
#productsGrid .col-sm-6 { margin-bottom: 24px; }

/* ===============================
   LINK STYLING
   =============================== */
.product-catalog-card-link { text-decoration: none; color: inherit; display: block; }
.product-catalog-card-link:hover { text-decoration: none; color: inherit; }

/* ===============================
   BOOTSTRAP OVERRIDES
   =============================== */
.btn-success {
    background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-hover) 100%);
    border-color: var(--green-dark);
    box-shadow: 0 3px 10px rgba(100,142,55,0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--green-hover) 0%, var(--green-dark) 100%);
    border-color: var(--green-hover);
}

.text-success { color: var(--green-dark) !important; }

/* ===============================
   RESPONSIVE
   =============================== */
@media (max-width: 768px) {
    .catalog-hero { padding: 120px 0 60px; margin-top: 56px; }
    .catalog-hero-title { font-size: 2rem; }
    .catalog-hero-actions { gap: 10px; }
    .catalog-toolbar-btn { padding: 10px 18px; font-size: 0.83rem; }

    .filter-panel.filter-panel--open { max-height: 700px; }

    .filter-panel-inner { padding: 16px 0; }

    .filter-panel-header {
        flex-direction: row;
        align-items: center;
        margin-bottom: 14px;
    }

    .filter-panel-row {
        flex-direction: column;
        gap: 12px;
    }

    .filter-panel-field {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
    }

    .filter-field-search { flex: 1 1 100%; }

    .filter-input,
    .filter-select {
        height: 46px;
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    .filter-section { padding: 16px; }
    .product-image-wrapper { height: 240px; }
    .product-info { padding: 14px; }
    .product-title { font-size: 1rem; }
    .product-description { font-size: 0.82rem; }
}

@media (min-width: 1200px) { .product-image-wrapper { height: 300px; } }

/* ===============================
   NO RESULTS
   =============================== */
#noResults { padding: 60px 20px; }
#noResults img { opacity: 0.3; }

/* ===============================
   PRODUCT ANIMATION
   =============================== */
.product-item { transition: opacity 0.3s ease, transform 0.3s ease; }
.product-item.fade-out { opacity: 0; transform: translateY(-10px); }
.product-item.fade-in { animation: fadeSlideIn 0.4s ease-out forwards; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

.product-item.fade-in:nth-child(1)  { animation-delay: 0s; }
.product-item.fade-in:nth-child(2)  { animation-delay: 0.04s; }
.product-item.fade-in:nth-child(3)  { animation-delay: 0.08s; }
.product-item.fade-in:nth-child(4)  { animation-delay: 0.12s; }
.product-item.fade-in:nth-child(5)  { animation-delay: 0.16s; }
.product-item.fade-in:nth-child(6)  { animation-delay: 0.2s; }
.product-item.fade-in:nth-child(7)  { animation-delay: 0.24s; }
.product-item.fade-in:nth-child(8)  { animation-delay: 0.28s; }
.product-item.fade-in:nth-child(9)  { animation-delay: 0.32s; }
.product-item.fade-in:nth-child(10) { animation-delay: 0.36s; }
.product-item.fade-in:nth-child(11) { animation-delay: 0.4s; }
.product-item.fade-in:nth-child(12) { animation-delay: 0.44s; }

/* ===============================
   LOADING ANIMATION
   =============================== */
.products-loading { position: relative; min-height: 400px; }

.products-loading-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 100; min-height: 400px; border-radius: 8px;
    transition: opacity 0.3s ease;
}

.products-loading-overlay.hidden { opacity: 0; pointer-events: none; }

.loading-spinner {
    width: 50px; height: 50px;
    border: 4px solid #e8e8e8;
    border-top: 4px solid var(--green-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.loading-text { color: var(--green-dark); font-size: 0.95rem; font-weight: 600; }
.loading-logo { width: 60px; height: 60px; margin-bottom: 15px; opacity: 0.6; }


/* Performance & Font Improvements */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    letter-spacing: -0.02em;
}
img { max-width: 100%; height: auto; }
.catalog-grid, .product-list { content-visibility: auto; }