/* ═══════════════════════════════════════════════════════════════
   ASABA SEAFOOD — FIXES.CSS
   Enqueue this AFTER style.css (lower priority number = earlier).
   Covers: search form, topbar cleanup, product grid, archive page.
   ═══════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────
   1. SEARCH FORM
   The topbar-search wrapper already provides
   the pill container. We just style the inner form.
────────────────────────────────────────── */

/* Hide the default WP search submit button — the SVG icon is enough */
.asaba-search-form {
    display: contents; /* Form fills the wrapper flex-row naturally */
}
.asaba-search-form input[type="search"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-size: 14px;
    font-family: var(--font-body);
    min-width: 0;
    /* Remove browser default search cancel button */
    -webkit-appearance: none;
    appearance: none;
}
.asaba-search-form input[type="search"]::-webkit-search-cancel-button,
.asaba-search-form input[type="search"]::-webkit-search-decoration {
    display: none;
}
.asaba-search-form input[type="search"]::placeholder {
    color: var(--muted2);
}
.asaba-search-submit {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    transition: color 0.2s;
    flex-shrink: 0;
}
.asaba-search-submit:hover { color: var(--orange); }
/* Show submit only when input has value — optional progressive enhancement */
.topbar-search:focus-within .asaba-search-submit { color: var(--orange); }

/* Hide the SVG search icon span in the wrapper — the form's own SVG takes over */
.topbar-search .search-icon {
    color: var(--muted);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ──────────────────────────────────────────
   2. TOPBAR — remove notification bell styles
   (bell is gone from header.php, but add a
   safety rule in case old markup lingers)
────────────────────────────────────────── */
.topbar-btn[href*="cart-2"],
.topbar-btn .notif-dot {
    display: none !important;
}

/* Cart button — keep clean without the bell next to it */
.topbar-cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--orange);
    color: #fff;
    border-radius: 10px;
    padding: 0 16px;
    height: 40px;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s;
    white-space: nowrap;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
}
.topbar-cart-btn:hover { background: var(--orange2); color: #fff; }
.topbar-cart-label { /* hide label on very small phones */ }
.topbar-cart-count {
    background: rgba(0,0,0,0.25);
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

/* Cart count = 0 → slightly dim the badge */
.topbar-cart-count:empty,
.topbar-cart-count[data-count="0"] { opacity: 0.5; }

/* ──────────────────────────────────────────
   3. PRODUCT GRID (archive & category pages)
────────────────────────────────────────── */

/* Override WooCommerce's default <ul class="products"> */
ul.products {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important; /* let our grid below override */
}
ul.products li.product {
    /* reset WC floats */
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Our grid container — used by loop-start.php AND ul.products fallback */
.asaba-product-grid,
ul.products.columns-4,
ul.products.columns-3,
ul.products {
    display: grid !important;
    grid-template-columns: repeat( auto-fill, minmax(220px, 1fr) );
    gap: 16px;
    padding: 0 32px 48px;
    list-style: none;
    margin: 0;
}

/* ── The dish card (content-product.php) ── */
.dish-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}
.dish-card:hover {
    border-color: rgba(255,98,64,0.4);
    transform: translateY(-5px);
    box-shadow: 0 20px 56px rgba(0,0,0,0.55);
}

/* Image container — consistent 200px height */
.dish-card .dish-img {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, rgba(255,98,64,0.07), rgba(0,212,168,0.05));
    display: flex;
    align-items: center;
    justify-content: center;
}
.dish-card .dish-img a {
    display: block;
    width: 100%;
    height: 100%;
}
.dish-card .dish-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.38s ease;
}
.dish-card:hover .dish-img img {
    transform: scale(1.06);
}

/* Emoji fallback when no image */
.dish-card .dish-emoji {
    font-size: 72px;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.4));
    transition: transform 0.35s cubic-bezier(.34,1.56,.64,1);
    line-height: 1;
}
.dish-card:hover .dish-emoji { transform: scale(1.18) rotate(-6deg); }

/* Badges */
.dish-label {
    position: absolute;
    top: 12px; left: 12px;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 2;
}
.dish-label.hot { background: var(--orange); color: #fff; }
.dish-label.new { background: var(--teal);   color: #fff; }

/* Fav button */
.dish-fav {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    z-index: 2;
    background-color: rgba(0,0,0,0.35);
}
.dish-fav:hover  { background: rgba(255,98,64,0.3); border-color: rgba(255,98,64,0.5); }
.dish-fav.active { background: rgba(231,76,60,0.25); border-color: rgba(231,76,60,0.5); }

/* Body */
.dish-card .dish-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.dish-card .dish-cat {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 5px;
}
.dish-card .dish-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
    line-height: 1.3;
    margin: 0 0 8px;
}
.dish-card .dish-name a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.2s;
}
.dish-card .dish-name a:hover { color: var(--orange2); }
.dish-card .dish-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.dish-card .dish-rating { font-size: 12px; font-weight: 600; color: var(--gold); }
.dish-card .dish-dot {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--muted2);
    flex-shrink: 0;
}
.dish-card .dish-time { font-size: 12px; color: var(--muted); }
.dish-card .dish-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.dish-card .dish-price {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}
/* WooCommerce injects <ins> and <del> for sale prices */
.dish-card .dish-price .woocommerce-Price-amount { color: var(--gold); }
.dish-card .dish-price del { font-size: 12px; color: var(--muted2); font-weight: 400; display: block; text-decoration: line-through; }
.dish-card .dish-price ins { text-decoration: none; display: block; }

/* ── WooCommerce injects its own title/price wrappers — hide them ── */
.dish-card h2.woocommerce-loop-product__title,
.dish-card .price:not(.dish-price .price) {
    display: none !important;
}

/* ──────────────────────────────────────────
   4. ARCHIVE PAGE CHROME
────────────────────────────────────────── */

/* Hero block at top of category page */
.archive-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 40px 32px 28px;
}
.archive-hero-emoji {
    font-size: 64px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.archive-hero-thumb {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border2);
}
.archive-hero-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 6px;
    line-height: 1.1;
}
.archive-hero-desc {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
    max-width: 500px;
}

/* Breadcrumbs */
.asaba-breadcrumbs {
    font-size: 12px;
    color: var(--muted2);
    margin-bottom: 12px;
    display: block;
}
.asaba-breadcrumbs a { color: var(--muted); }
.asaba-breadcrumbs a:hover { color: var(--orange); }

/* ── Category pill filter bar ── */
.archive-cat-pills {
    display: flex;
    gap: 8px;
    padding: 0 32px 24px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
}
.archive-cat-pills::-webkit-scrollbar { display: none; }

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    color: var(--muted);
    background: var(--card);
    flex-shrink: 0;
}
.cat-pill:hover {
    border-color: rgba(255,98,64,0.35);
    color: var(--white);
    background: rgba(255,98,64,0.08);
}
.cat-pill.active {
    background: rgba(255,98,64,0.15);
    border-color: rgba(255,98,64,0.5);
    color: var(--orange);
}

/* ── Sort + count toolbar ── */
.archive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px 20px;
    gap: 12px;
}
.woocommerce-result-count {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}
.woocommerce-ordering select {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 32px 8px 14px;
    color: var(--white);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238896A6' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s;
}
.woocommerce-ordering select:focus { border-color: var(--orange); }
.woocommerce-ordering select option { background: var(--card2); color: var(--white); }

/* ── Pagination ── */
.archive-pagination {
    padding: 8px 32px 60px;
    display: flex;
    justify-content: center;
}
.woocommerce-pagination ul {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}
.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.woocommerce-pagination ul li a:hover { border-color: rgba(255,98,64,0.4); color: var(--white); background: rgba(255,98,64,0.1); }
.woocommerce-pagination ul li span.current { background: var(--orange); border-color: var(--orange); color: #fff; }

/* "No products found" state */
.woocommerce-info {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--orange);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--white);
    padding: 16px 20px;
    margin: 0 32px 40px;
    font-size: 14px;
}
.woocommerce-info::before { display: none; }

/* ──────────────────────────────────────────
   5. SEARCH RESULTS PAGE
────────────────────────────────────────── */
.search-results .blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
/* WooCommerce products in search results */
.search-results .asaba-product-grid,
.search-results ul.products {
    padding: 0 32px 40px;
}

/* ──────────────────────────────────────────
   6. RESPONSIVE OVERRIDES
────────────────────────────────────────── */
@media (max-width: 1024px) {
    .asaba-product-grid, ul.products {
        grid-template-columns: repeat(3, 1fr);
        padding: 0 24px 40px;
    }
    .archive-hero    { padding: 32px 24px 20px; }
    .archive-cat-pills { padding: 0 24px 20px; }
    .archive-toolbar { padding: 0 24px 16px; }
    .archive-pagination { padding: 0 24px 48px; }
}
@media (max-width: 768px) {
    .asaba-product-grid, ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 16px 32px;
    }
    .archive-hero {
        padding: 24px 16px 16px;
        gap: 14px;
    }
    .archive-hero-title { font-size: 26px; }
    .archive-hero-emoji { font-size: 48px; }
    .archive-hero-thumb { width: 54px; height: 54px; }
    .archive-cat-pills { padding: 0 16px 16px; gap: 6px; }
    .cat-pill { font-size: 12px; padding: 7px 12px; }
    .archive-toolbar { padding: 0 16px 14px; }
    .archive-pagination { padding: 0 16px 48px; }
    .dish-card .dish-img { height: 170px; }
    .dish-card .dish-name { font-size: 14px; }
    .dish-card .dish-price { font-size: 16px; }
}
@media (max-width: 480px) {
    .asaba-product-grid, ul.products {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 0 12px 28px;
    }
    .archive-hero { padding: 20px 12px 14px; }
    .archive-cat-pills { padding: 0 12px 14px; }
    .archive-toolbar { padding: 0 12px 12px; flex-wrap: wrap; }
    .dish-card .dish-img { height: 140px; }
    .dish-card .dish-emoji { font-size: 52px; }
    .dish-card .dish-body { padding: 10px 12px 12px; }
    .dish-card .dish-name { font-size: 13px; }
    .dish-card .dish-price { font-size: 14px; }
    .dish-card .add-btn { width: 30px; height: 30px; font-size: 16px; }
    .topbar-cart-label { display: none; }
    .woocommerce-result-count { font-size: 12px; }
}
@media (max-width: 360px) {
    .asaba-product-grid, ul.products {
        grid-template-columns: 1fr;
    }
    .dish-card .dish-img { height: 200px; }
}
