/* Ganapathy Foods — custom additions on top of the Cake template (css/style.css) */

:root {
    --gf-primary: #f08632;
    --gf-secondary: #0c2b4b;
    --gf-border: #e1e1e1;
}

/* ---------- Sticky header ---------- */
/* position:sticky released partway down the page because the vendor stylesheet
   sets `html, body { height: 100%; }` — that caps the header's containing
   block at one viewport height, so sticky stops working past that point even
   though the page keeps scrolling. position:fixed is always relative to the
   viewport instead, so it can't be affected by that. js/custom.js pads <body>
   by the header's real rendered height so fixed content doesn't sit under it.
   z-index 40 keeps it below the offcanvas overlay/panel (98/99) and search
   modal (99999) so those still layer correctly on top when opened. */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 40;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
/* scoped to storefront-only pages (see includes/header.php) so this doesn't
   push down the admin panel, which uses its own separate header */
body.storefront-body { padding-top: 165px; } /* static fallback before js/custom.js measures the real height; prevents a flash of content under the header */
@media (max-width: 767px) {
    body.storefront-body { padding-top: 110px; }
}

/* ---------- Header: Track Order button ---------- */
.header__track-btn {
    display: inline-block;
    background: none;
    color: var(--gf-secondary) !important;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 7px 15px;
    border: 1px solid var(--gf-secondary);
    border-radius: 3px;
    transition: background .2s ease, color .2s ease;
}
.header__track-btn:hover {
    background: var(--gf-secondary);
    color: #fff !important;
}

/* ---------- Header: cart count badge ---------- */
/* Vendor default was plain text absolutely placed inside the icon's outline —
   fine for a single digit, but a 2-digit count overlapped the icon artwork.
   Turn it into a proper small pill badge sitting at the icon's corner instead. */
.header__top__right__cart a span,
.offcanvas__cart__item a span {
    left: auto;
    right: -8px;
    top: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    background: var(--gf-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
}

/* ---------- Header: Sign in / My Account button ---------- */
/* Was plain default-blue link text next to the search icon — barely visible
   against the white header bar. Give it real button styling. */
.header__top__right__links a { margin-right: 14px; } /* was 56px, sized for the old plain text link */
.header__signin-btn {
    display: inline-block;
    background: var(--gf-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 8px 16px;
    border-radius: 3px;
    transition: background .2s ease;
}
.header__signin-btn:hover {
    background: var(--gf-secondary);
    color: #fff;
}
/* The button is wider than the plain text link it replaced, so the row can run
   out of room and wrap "Cart: ₹ ..." onto its own line at tablet widths. */
.header__top__right { white-space: nowrap; }
.header__top__right__cart,
.header__top__right__cart .cart__price { white-space: nowrap; }
@media (min-width: 768px) and (max-width: 991px) {
    .header__signin-btn { padding: 8px 12px; font-size: 12px; }
    .header__top__right__links a { margin-right: 8px; }
}

/* ---------- Logo (circular badge, replaces template's rectangular default) ---------- */
.header__logo img,
.offcanvas__logo img,
.footer__about .footer__logo img {
    width: 84px;
    height: 84px;
}
.footer__about .footer__logo img { width: 90px; height: 90px; }
@media (min-width: 768px) {
    .header__logo {
        margin-left: -42px; /* half of the 84px logo width, keeps it centered */
        top: 9px; /* vertically centers an 84px badge in the 102px header bar */
    }
}

/* ---------- General helpers ---------- */
.alert { border-radius: 0; padding: 14px 18px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #eaf7ea; color: #1f6d2c; border: 1px solid #bfe6bf; }
.alert-danger { background: #fbeaea; color: #8a1f1f; border: 1px solid #f0bcbc; }
.mt-3 { margin-top: 15px; } .mt-4 { margin-top: 25px; } .mb-0 { margin-bottom: 0; }
.d-inline { display: inline; }

/* ---------- Product card image link ---------- */
/* product__item__pic is an <a> here (clickable through to details) instead of the
   template's original <div> — <a> defaults to display:inline, which makes the
   vendor stylesheet's `height: 270px` on .product__item__pic a no-op. Restore block. */
.product__item__pic { display: block; }

/* ---------- Breadcrumb banner (used on every interior page) ---------- */
/* Vendor default was padding-top:60px plus a 50px heading and an 80px section
   below it — far too much dead space for a dense listing page. */
.breadcrumb-option { padding-top: 28px; padding-bottom: 18px; }
.breadcrumb__text h2 { font-size: 32px; }
.breadcrumb__links { padding-top: 6px; }

/* ---------- Active filter chips (search term, category, occasion, price) ---------- */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.active-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    color: #333;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 3px;
    border: 1px solid var(--gf-border);
}
.active-filters__chip:hover { background: #eee; color: #333; }
.active-filters__chip span { color: #999; font-size: 15px; line-height: 1; }
.active-filters__chip:hover span { color: var(--gf-primary); }
.active-filters__clearall {
    font-size: 13px;
    color: var(--gf-primary);
    text-decoration: underline;
    margin-left: 4px;
}

/* ---------- Shop sidebar / filters ---------- */
.shop { padding-top: 25px; }
.shop__sidebar { border: 1px solid var(--gf-border); padding: 25px; }
.shop__sidebar__widget { margin-bottom: 30px; }
.shop__sidebar__widget:last-child { margin-bottom: 0; }
.shop__sidebar__widget h5 { font-size: 16px; font-weight: 700; margin-bottom: 15px; text-transform: uppercase; letter-spacing: .5px; }
.shop__sidebar__categories { list-style: none; padding: 0; margin: 0; }
.shop__sidebar__categories li { margin-bottom: 8px; }
.shop__sidebar__categories li a { color: #5c5c5c; font-size: 14px; }
.shop__sidebar__categories li.active a,
.shop__sidebar__categories li a:hover { color: var(--gf-primary); font-weight: 600; }
.shop__sidebar__price { display: flex; gap: 10px; margin-bottom: 12px; }
.shop__sidebar__price input { width: 50%; border: 1px solid var(--gf-border); padding: 8px 10px; }
.shop__filter__apply { width: 100%; text-align: center; padding: 10px; border: none; cursor: pointer; }

.shop__result__count { padding-top: 12px; color: #5c5c5c; }
/* The sort <select> sits inside a <form> so it can submit itself; forms default
   to display:block, which pushed the view-toggle icons onto their own row. */
.shop__option__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}
.shop__option__right form { margin: 0; }
.shop__option__right .nice-select {
    width: 150px;
    height: 38px;
    line-height: 36px;
    padding-left: 15px;
    padding-right: 25px;
    margin-right: 0;
    font-size: 14px;
}
.shop__option__right .nice-select .list { width: 100%; }
.shop__option__right a { color: #999; font-size: 16px; }
.shop__option__right a.active-view { color: var(--gf-primary); }
.shop__pagination a.active-page { background: var(--gf-primary); color: #fff; }

/* ---------- Add to cart button ---------- */
/* Vendor default: hidden (opacity:0) until desktop :hover, when it swaps in over
   the price. Invisible by default and unreachable on touch devices — make it a
   permanent, clearly-styled button instead. */
.product__item__text .product__item__price,
.product__item:hover .product__item__text .product__item__price {
    opacity: 1;
    visibility: visible;
}
.product__item__text .cart_add,
.product__item:hover .product__item__text .cart_add {
    position: static;
    opacity: 1;
    visibility: visible;
    margin-top: auto;
    padding-top: 12px;
}
/* Grid cards vary in height when a product name wraps to two lines — stretch
   every card in the row to match the tallest one, and anchor the button to the
   bottom of each card, so price + button line up evenly across a row. */
.product .row,
.shop .row,
.related__products__slider.owl-carousel .owl-stage { align-items: stretch; }
.product__item {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    margin-bottom: 0;    /* vendor default margin-bottom:40px sits outside height:100% and breaks the stretch math */
    padding-bottom: 40px; /* same visual row-gap, but inside the box so stretch heights stay correct */
}
.product__item__pic { flex-shrink: 0; }
.product__item__text { flex: 1; display: flex; flex-direction: column; }
.product__item .cart_add form { margin: 0; }
.product__item .cart_add button {
    display: inline-block;
    background: var(--gf-primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-radius: 3px;
    cursor: pointer;
    transition: background .2s ease;
}
.product__item .cart_add button:hover {
    background: var(--gf-secondary);
}

/* ---------- List view product cards ---------- */
/* .product__item--list shares the base .product__item class, which sets
   flex-direction:column for the grid-alignment fix above — without an
   explicit override here that column direction silently won (both rules
   have equal specificity), collapsing the image to zero height in list view. */
.product__item--list { display: flex; flex-direction: row; align-items: stretch; height: auto; margin-bottom: 20px; }
.product__item--list .product__item__pic { width: 220px; min-width: 220px; height: auto; }
.product__item--list .product__item__text { flex: 1; padding: 15px 0 15px 20px; text-align: left; }
.product__item--list .product__item__desc { color: #5c5c5c; font-size: 14px; margin-top: 6px; }

/* ---------- Product details: tiers ---------- */
.tier__option { display: block; margin-bottom: 8px; font-size: 14px; cursor: pointer; }
.tier__option input { margin-right: 8px; }

/* ---------- Cart ---------- */
/* Vendor CSS never constrains the thumbnail size, so it rendered at the
   product photo's full original dimensions — shrink to a proper thumbnail. */
.product__cart__item__pic { width: 100px; }
.product__cart__item__pic img { width: 100px; height: 100px; object-fit: cover; }
.cart-empty { text-align: center; padding: 50px 0; }
.cart-empty__text { font-size: 20px; color: #5c5c5c; margin-bottom: 20px; }
.cart__item__unit { color: #999; font-size: 13px; margin: 2px 0; }
.cart__combo-badge {
    display: inline-block;
    background: var(--gf-secondary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 2px 6px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 6px;
}

/* ---------- Combo pricing / cards ---------- */
.combo-price__strike { text-decoration: line-through; color: #999; font-size: 14px; margin-right: 6px; }
.combo-price__offer { color: var(--gf-primary); font-weight: 700; }
.combo-price__plain { font-weight: 700; }
.combo-card__items { color: #5c5c5c; font-size: 13px; margin-top: 6px; }
.combo-empty { text-align: center; padding: 60px 0; font-size: 20px; color: #5c5c5c; }
/* Qty +/- and remove controls: vendor sizing was too small to tap comfortably,
   and the remove control is a <button> here (needs to submit a form) while the
   vendor CSS only styled a <span>, so it rendered as a bare, unstyled glyph. */
.shopping__cart__table table tbody tr td.quantity__item .quantity .pro-qty {
    width: auto;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.shopping__cart__table table tbody tr td.quantity__item .quantity .pro-qty .qtybtn {
    font-size: 18px;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f2;
    border-radius: 50%;
    color: #111111;
    transition: background .2s ease, color .2s ease;
}
.shopping__cart__table table tbody tr td.quantity__item .quantity .pro-qty .qtybtn:hover {
    background: var(--gf-primary);
    color: #fff;
}
.shopping__cart__table table tbody tr td.quantity__item .quantity .pro-qty input {
    flex-shrink: 0;
}
.shopping__cart__table table tbody tr td.cart__close button {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111111;
    height: 40px;
    width: 40px;
    background: #f2f2f2;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s ease, color .2s ease;
}
.shopping__cart__table table tbody tr td.cart__close button:hover {
    background: var(--gf-primary);
    color: #fff;
}
/* "Update cart" has to be a real <button> so it can submit the form, but the
   vendor CSS only styles `.continue__btn a` — mirror that styling for buttons
   too so it doesn't fall back to unstyled browser button chrome. */
.continue__btn button {
    color: #111111;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px solid var(--gf-border);
    padding: 14px 35px;
    display: inline-block;
    background: none;
    font-family: inherit;
    cursor: pointer;
}
.continue__btn.update__btn button {
    color: #fff;
    background: #111111;
    border-color: #111111;
}
.continue__btn.update__btn button i { margin-right: 5px; }
.cart-clear-btn {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 13px;
    text-decoration: underline;
    padding: 10px 0 0;
    cursor: pointer;
}
.cart-clear-btn:hover { color: #8a1f1f; }
.cart-table__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.cart-table__toolbar .cart-clear-btn { padding: 0; }
.cart-table__count { color: #5c5c5c; font-size: 14px; }

/* ---------- Confirmation popup (replaces native confirm()) ---------- */
.confirm-modal {
    background: #fff;
    max-width: 380px;
    margin: 40px auto;
    padding: 30px;
    text-align: center;
    border-radius: 4px;
}
.confirm-modal h5 { font-weight: 700; margin-bottom: 12px; }
.confirm-modal p { color: #5c5c5c; font-size: 14px; margin-bottom: 22px; }
.confirm-modal__actions { display: flex; gap: 12px; justify-content: center; }
.btn-cancel-popup,
.btn-confirm-popup {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 10px 20px;
    border-radius: 3px;
    cursor: pointer;
}
.btn-cancel-popup { background: none; border: 1px solid var(--gf-border); color: #111; }
.btn-cancel-popup:hover { background: #f5f5f5; }
.btn-confirm-popup { background: #c0392b; border: 1px solid #c0392b; color: #fff; }
.btn-confirm-popup:hover { background: #8a1f1f; border-color: #8a1f1f; }
.confirm-modal-popup .mfp-bg { background: rgba(0, 0, 0, 0.7); opacity: 1; }

/* ---------- Checkout ---------- */
.checkout__payment__label { font-weight: 700; margin-top: 15px; margin-bottom: 8px; }

/* ---------- QR payment box ---------- */
.qr-payment-box { text-align: center; padding: 20px; border: 1px dashed var(--gf-border); margin: 15px 0; }
.qr-payment-box__img { max-width: 240px; margin: 15px auto; display: block; border: 1px solid var(--gf-border); }
.qr-payment-box input[type="file"] { display: block; margin: 15px auto; }

.order-confirmation__box { border: 1px solid var(--gf-border); padding: 30px; }

/* ---------- Order tracking timeline ---------- */
.order-tracking__timeline { display: flex; list-style: none; padding: 0; margin: 25px 0; }
.order-tracking__timeline li { flex: 1; text-align: center; position: relative; color: #bbb; }
.order-tracking__timeline li:not(:last-child)::after {
    content: ''; position: absolute; top: 8px; left: 55%; width: 90%; height: 2px; background: #e1e1e1;
}
.order-tracking__timeline li.done:not(:last-child)::after { background: var(--gf-primary); }
.order-tracking__timeline .dot {
    display: block; width: 18px; height: 18px; border-radius: 50%; background: #e1e1e1;
    margin: 0 auto 8px; position: relative; z-index: 1;
}
.order-tracking__timeline li.done .dot { background: var(--gf-primary); }
.order-tracking__timeline li.done { color: var(--gf-secondary); font-weight: 600; }
.order-tracking__timeline .label { display: block; font-size: 13px; }
.order-status-history { list-style: none; padding: 0; font-size: 14px; color: #5c5c5c; }
.order-status-history li { padding: 4px 0; border-bottom: 1px solid #f2f2f2; }
.tracking__form { margin-bottom: 20px; }

/* ---------- Account ---------- */
.address-card { border: 1px solid var(--gf-border); padding: 15px; margin-bottom: 12px; font-size: 14px; }
.address-card__remove { background: none; border: none; color: #c0392b; padding: 0; margin-top: 6px; cursor: pointer; font-size: 13px; }

/* =====================================================
   Admin panel
   ===================================================== */
.admin-body { background: #f4f5f7; font-family: 'Nunito Sans', Arial, sans-serif; }
.admin-login-body { background: var(--gf-secondary); display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; }
.admin-login-box { background: #fff; padding: 40px; width: 360px; max-width: 90vw; }
.admin-login-box h4 { margin-bottom: 20px; text-align: center; }

.admin-topbar {
    background: var(--gf-secondary); color: #fff; padding: 12px 25px;
    display: flex; justify-content: space-between; align-items: center;
}
.admin-topbar__brand { font-weight: 700; font-size: 18px; }
.admin-topbar__brand span { font-weight: 400; opacity: .7; font-size: 14px; }
.admin-topbar__user a { color: #fff; text-decoration: underline; }

.admin-shell { display: flex; min-height: calc(100vh - 48px); }
.admin-sidebar { width: 220px; background: #fff; border-right: 1px solid #e5e5e5; padding: 20px 0; }
.admin-nav__link {
    display: block; padding: 10px 25px; color: #444; font-size: 14px; text-decoration: none;
}
.admin-nav__link i { width: 20px; display: inline-block; }
.admin-nav__link:hover { background: #f4f5f7; text-decoration: none; }
.admin-nav__link.active { background: var(--gf-primary); color: #fff; }

.admin-main { flex: 1; padding: 25px 30px; }
.admin-page-title { margin-bottom: 20px; font-weight: 700; }

.admin-card { background: #fff; border: 1px solid #e5e5e5; padding: 20px; margin-bottom: 20px; }
.admin-card--form { max-width: 900px; }
.admin-card h5 { font-weight: 700; margin-bottom: 15px; }
.admin-card__toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }

.admin-stat-row { margin-bottom: 5px; }
.admin-stat-card { background: #fff; border: 1px solid #e5e5e5; padding: 20px; text-align: center; margin-bottom: 20px; }
.admin-stat-card span { display: block; font-size: 28px; font-weight: 700; color: var(--gf-secondary); }
.admin-stat-card p { margin: 5px 0 0; color: #777; font-size: 13px; text-transform: uppercase; }
.admin-stat-card--warn span { color: #c0392b; }

.admin-thumb-sm { width: 45px; height: 45px; object-fit: cover; }
.admin-thumb-preview { max-width: 140px; max-height: 140px; object-fit: cover; margin-bottom: 8px; display: block; }
.admin-payment-screenshot { max-width: 100%; border: 1px solid #e5e5e5; margin-top: 10px; }

.admin-link { background: none; border: none; color: #0c6dbd; padding: 0; cursor: pointer; font-size: 13px; }
.admin-link-danger { background: none; border: none; color: #c0392b; padding: 0; cursor: pointer; font-size: 13px; margin-left: 8px; }

.admin-checkbox-inline { display: inline-block; margin-right: 15px; font-size: 14px; font-weight: 400; }

.admin-tier-table th, .admin-tier-table td { vertical-align: middle; }
.admin-tier-table input[type="text"], .admin-tier-table input[type="number"] { min-width: 90px; }

.admin-image-grid { display: flex; flex-wrap: wrap; gap: 15px; }
.admin-image-grid__item { border: 1px solid #e5e5e5; padding: 8px; text-align: center; width: 140px; }
.admin-image-grid__item img { width: 100%; height: 100px; object-fit: cover; margin-bottom: 8px; }
.admin-image-grid__item label { display: block; font-size: 12px; margin: 2px 0; }

.badge-status {
    display: inline-block; padding: 3px 10px; font-size: 12px; border-radius: 3px; text-transform: capitalize;
    background: #eee; color: #333;
}
.badge-status--placed { background: #eaf7ea; color: #1f6d2c; }
.badge-status--processing { background: #fff4e0; color: #a5670c; }
.badge-status--out_for_delivery { background: #e6f0fb; color: #1a5aa0; }
.badge-status--completed { background: #e0f2f1; color: #00695c; }
.badge-status--cancelled { background: #fbeaea; color: #8a1f1f; }

@media (max-width: 767px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 10px 0; }
    .admin-nav__link { white-space: nowrap; }
    .product__item--list { flex-direction: column; }
    .product__item--list .product__item__pic { width: 100%; height: 220px; }
    .product__item--list .product__item__text { padding: 15px; }
}
