@import url("./components/header.css");
@import url("./components/footer.css");

/* =======================
   LAYOUT
======================= */
.filter-sections {
    padding: 1rem 0;
    background: #f5f6f8;
}

/* =======================
   FILTER SIDEBAR
======================= */
.filter-sidebar {
    background: #ffffff;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #f1f1f1;
}

.filter-sidebar h6 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 18px;
    color: #222;
    position: relative;
    padding-bottom: 8px;
}

.filter-sidebar h6::after {
    content: "";
    width: 40px;
    height: 3px;
    background: #9198a0;
    position: absolute;
    left: 0;
    bottom: 0;
    border-radius: 4px;
}

.category-scroll {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 6px;
}

.category-scroll::-webkit-scrollbar {
    width: 6px;
}

.category-scroll::-webkit-scrollbar-thumb {
    background: #dcdcdc;
    border-radius: 10px;
}

.filter-sidebar .form-check {
    margin-bottom: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #f5f5f5;
    transition: all .25s ease;
}

.filter-sidebar .form-check:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.filter-sidebar .form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border-radius: 5px;
    border: 2px solid #dcdcdc;
    cursor: pointer;
}

.filter-sidebar .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.filter-sidebar .form-check-label {
    font-size: 15px;
    font-weight: 500;
    color: #444;
    width: 100%;
}

.filter-sidebar .badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 20px;
    background: #f1f3f5 !important;
    color: #666 !important;
}

/* =======================
   PRODUCT CARD
======================= */
.ingredient-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ingredient-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform .35s ease;
}

.ingredient-card:hover .ingredient-image {
    transform: scale(1.05);
}

.ingredient-title {
    min-height: 48px;
    padding: 0 14px;
    margin: 18px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: #2c2c2c;
}

/* =======================
   ACTION AREA
======================= */
.ingredient-actions {
    margin-top: auto;
    padding: 12px;
}

.ingredient-actions.compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-qty-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 6px 8px;
    border-radius: 10px;
}

.price-text {
    font-size: 14px;
    font-weight: 600;
}

.qty-inline {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: #f2f2f2;
    font-size: 16px;
    cursor: pointer;
}

.qty-btn:hover {
    background: #e6e6e6;
}

.qty-value {
    min-width: 22px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.cart-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
}

.cart-btn i {
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 100%;
    height: 100%;
    margin: 0;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.view_product {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid #111;
    background: #111;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.view_product:hover {
    background: #fff;
    color: #111;
    border-color: #111;
}

/* =======================
   SEARCH AUTOCOMPLETE
======================= */
.search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    z-index: 1200;
    max-height: 360px;
    overflow-y: auto;
    padding: 6px;
}

.search-item {
    display: flex;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background .25s ease, transform .2s ease;
}

.search-item:hover {
    background: #f9fafb;
    transform: translateY(-1px);
}

.search-item img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
}

/* =======================
   MOBILE
======================= */
@media (max-width: 991px) {

    main {
        margin: 0;
    }

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        height: 100%;
        z-index: 1050;
        transition: left .3s ease;
        border-radius: 0;
        overflow-y: auto;
    }

    .filter-sidebar.show {
        left: 0;
    }

    .filter-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        opacity: 0;
        pointer-events: none;
        transition: .3s;
    }

    .filter-overlay.show {
        opacity: 1;
        pointer-events: all;
    }

    .ingredient-title {
        font-size: 0.9rem;
    }
}



.search-input-wrapper {
    position: relative;
}

.search-input {
    padding-right: 45px; /* space for icon */
    height: 44px;
}

.search-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #666;
}

.search-btn:hover {
    color: #000;
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cfd4da;
    border-radius: 999px;
    background: #fff;
    color: #2c2c2c;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
}

.filter-toggle.active {
    background: #2c2c2c;
    color: #fff;
    border-color: #2c2c2c;
}

.filter-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.filter-close-btn {
    border: none;
    background: transparent;
    color: #2c2c2c;
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px;
}

.filter-close-btn:hover {
    opacity: 0.7;
}

.form-check .form-check-input {
    float: left;
    margin-left: 1em !important;
}

/* ================================
   CART TOAST
================================ */
.cart-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 280px;
    background: #28a745;
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    animation: slideInDown 0.3s ease;
}

.cart-toast.show {
    display: block !important;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.toast-icon {
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-text {
    flex: 1;
    min-width: 0;
}

.toast-text strong {
    display: block;
    font-size: 12px;
    margin-bottom: 1px;
    line-height: 1.3;
    font-weight: 600;
}

#toastMessage {
    font-size: 11px;
    opacity: 0.95;
    line-height: 1.2;
}

.toast-btn {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 10px;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
    display: inline-block;
}

.toast-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    color: white;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideInDown {
    from {
        transform: translateY(-400px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .cart-toast {
        top: auto;
        right: 12px;
        left: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        max-width: none;
        animation: slideInUp 0.3s ease;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
