/*
 * Storefront styles. Every colour, the font and the corner radius come from CSS variables written by the active
 * theme (App\Support\Theme, Admin › Appearance). The values below are only fallbacks.
 */
:root {
    --brand: #1f7a3a; --brand-dark: #165c2b; --brand-light: #e9f2ec; --brand-contrast: #fff;
    --accent: #f5a623; --accent-dark: #d88f19; --accent-contrast: #111;
    --sale: #e53935; --bg: #f4f6f3; --text: #222;
    --header-bg: #1f7a3a; --header-text: #fff; --nav-bg: #165c2b; --nav-text: #fff;
    --footer-bg: #10391d; --footer-text: #d6e5d9; --footer-bottom: #0b2914;
    --radius: 8px; --radius-sm: 5px; --btn-radius: 6px;
    --font: 'Hind Siliguri', system-ui, sans-serif;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); padding-bottom: 64px; }
@media (min-width: 992px) { body { padding-bottom: 0; } }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }

.btn { border-radius: var(--btn-radius); }
.btn-brand { background: var(--brand); color: var(--brand-contrast); border: 1px solid var(--brand); }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--brand-contrast); }
.btn-accent { background: var(--accent); color: var(--accent-contrast); border: 1px solid var(--accent); font-weight: 600; }
.btn-accent:hover, .btn-accent:focus { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--accent-contrast); }
.btn-outline-brand { background: transparent; color: var(--brand); border: 1px solid var(--brand); font-weight: 600; }
.btn-outline-brand:hover { background: var(--brand); color: var(--brand-contrast); }
.text-brand { color: var(--brand) !important; }
.form-control, .form-select { border-radius: var(--radius-sm); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 20%, transparent); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.page-link { color: var(--brand); }
.active > .page-link { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }

/* Notice ticker */
.notice-bar { background: var(--nav-bg); color: var(--nav-text); overflow: hidden; white-space: nowrap; font-size: .9rem; }
.notice-track { display: inline-block; padding: 4px 0 4px 100%; animation: ticker 40s linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* Header */
.site-header { background: var(--header-bg); color: var(--header-text); position: sticky; top: 0; z-index: 1030; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.site-header a, .site-header .btn-link { color: var(--header-text); }
.brand img { max-height: 48px; max-width: 170px; object-fit: contain; }
.brand span { font-weight: 700; font-size: 1.4rem; }
.search-box { background: #fff; border-radius: var(--radius-sm); overflow: hidden; max-width: 560px; border: 1px solid transparent; }
.header-light .search-box { background: #f3f4f6; border-color: #e5e7eb; }
.header-light .search-box .form-control { background: transparent; }
.search-box .form-control { border: 0; box-shadow: none; }
.search-box .btn { background: var(--accent); border-radius: 0; color: var(--accent-contrast); }
.header-light .search-box .btn { background: transparent; color: #374151; }

.header-actions { gap: 1.1rem !important; }
.header-action { display: flex; flex-direction: column; align-items: center; font-size: .78rem; line-height: 1.1; position: relative; background: none; border: 0; color: var(--header-text); padding: 0; }
.header-action i { font-size: 1.35rem; margin-bottom: 3px; }
.header-action:hover { opacity: .8; color: var(--header-text); }
.header-action .badge-count { position: absolute; top: -5px; right: -2px; transform: translateX(50%); background: var(--accent); color: var(--accent-contrast); border-radius: 10px; font-size: .65rem; padding: 1px 5px; font-weight: 700; min-width: 17px; text-align: center; }
.header-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin-bottom: 3px; border: 1px solid color-mix(in srgb, var(--header-text) 40%, transparent); }
.more-menu .dropdown-item { display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; color: #222; }
.more-menu .dropdown-item i { color: var(--brand); width: 18px; }
.more-menu .dropdown-item:hover { background: var(--brand-light); color: var(--brand); }

.category-nav { background: var(--nav-bg); }
.category-nav .nav-link { color: var(--nav-text); padding: .6rem .9rem; font-weight: 500; }
.category-nav .nav-link:hover { background: rgba(255,255,255,.1); color: var(--nav-text); }
.category-nav .dropdown:hover .dropdown-menu { display: block; margin-top: 0; }
.category-nav .dropdown-item { color: #222; }

/* Sections */
.section-title { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--brand); margin-bottom: 1rem; }
.section-title h2 { font-size: 1.25rem; font-weight: 700; background: var(--brand); color: var(--brand-contrast); padding: .4rem 1rem; margin: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.section-title a { font-size: .9rem; color: var(--brand); font-weight: 600; }

.hero-carousel img { width: 100%; aspect-ratio: 16 / 6; object-fit: cover; border-radius: var(--radius); }
.ad-banner img { width: 100%; border-radius: var(--radius); }

.category-tile { background: #fff; border-radius: var(--radius); padding: .75rem .5rem; text-align: center; height: 100%; transition: box-shadow .2s, transform .2s; }
.category-tile:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-2px); }
.category-tile img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; margin-bottom: .4rem; }
.category-tile span { display: block; font-size: .9rem; font-weight: 600; line-height: 1.2; }

/* Product card (style: shadow / border / flat) */
.product-card { background: #fff; border-radius: var(--radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; position: relative; transition: box-shadow .2s, transform .2s; }
.card-shadow .product-card { box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card-shadow .product-card:hover { box-shadow: 0 8px 22px rgba(0,0,0,.12); transform: translateY(-2px); }
.card-border .product-card { border: 1px solid #e5e7eb; }
.card-border .product-card:hover { border-color: var(--brand); }
.card-flat .product-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.product-card .thumb { aspect-ratio: 1; background: #fafafa; display: block; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: .6rem; display: flex; flex-direction: column; flex-grow: 1; }
.product-card .name { font-size: .95rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.product-card .card-actions { margin-top: auto; display: flex; gap: .4rem; }
.product-card .card-actions .btn { flex: 1 1 0; min-width: 0; font-size: .8rem; padding: .38rem .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Narrow cards (many per row, or phones): the two buttons stack instead of getting cut off. */
.product-card .body { container-type: inline-size; }
@container (max-width: 250px) { .card-actions { flex-direction: column; } .card-actions .btn { flex: none !important; width: 100%; } }
.btn-add-cart { background: transparent; color: var(--accent); border: 1px solid var(--accent); font-weight: 600; }
.btn-add-cart:hover { background: var(--accent); color: var(--accent-contrast); }
.cart-btn-filled .btn-add-cart { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.cart-btn-filled .btn-add-cart:hover { background: var(--brand-dark); }
.price { color: var(--brand); font-weight: 700; font-size: 1.05rem; }
.price del { color: #999; font-weight: 400; font-size: .85em; margin-right: .3rem; }
.sale-badge { position: absolute; top: 8px; left: 8px; background: var(--sale); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-sm); z-index: 2; }
.free-badge { position: absolute; top: 34px; left: 8px; background: var(--brand); color: var(--brand-contrast); font-size: .7rem; font-weight: 700; padding: 2px 6px; border-radius: var(--radius-sm); z-index: 2; }
.wish-btn { position: absolute; top: 8px; right: 8px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #555; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.15); transition: transform .15s; }
.wish-btn:hover { transform: scale(1.1); color: var(--sale); }
.wish-btn.active { color: var(--sale); }
.wish-btn-lg { position: static; width: auto; height: auto; border-radius: var(--btn-radius); padding: .45rem .9rem; box-shadow: none; border: 1px solid #ddd; gap: .4rem; }

/* Product detail */
.gallery-main { background: #fff; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--brand); }
.qty-control { display: inline-flex; border: 1px solid #ccc; border-radius: var(--radius-sm); overflow: hidden; }
.qty-control button { border: 0; background: #eee; width: 36px; }
.qty-control input { width: 54px; border: 0; text-align: center; }
.qty-control.qty-sm button { width: 28px; }
.qty-control.qty-sm input { width: 38px; font-size: .9rem; }
.rich-content img { max-width: 100%; height: auto; }
.rating i { color: var(--accent); }

.card-box { background: #fff; border-radius: var(--radius); padding: 1rem; }
.box-title { font-size: 1.05rem; font-weight: 700; border-left: 3px solid var(--accent); padding-left: .6rem; margin-bottom: 1rem; }

/* Checkout */
.payment-option { display: flex; align-items: center; gap: .75rem; border: 1px solid #dcdcdc; border-radius: var(--radius-sm); padding: .6rem .8rem; margin-bottom: .5rem; cursor: pointer; }
.payment-option:has(input:checked) { border-color: var(--brand); background: var(--brand-light); box-shadow: 0 0 0 1px var(--brand); }
.payment-option .form-check-input { margin: 0; flex-shrink: 0; }
.payment-logo { width: 64px; height: 27px; flex-shrink: 0; }
.free-progress { background: #fff8e6; border: 1px dashed var(--accent); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.account-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius); padding: .7rem 1rem; }
.coupon-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; padding: 0; font-weight: 600; text-align: left; }
.coupon-toggle i { transition: transform .2s; }
.coupon-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.coupon-applied { display: flex; align-items: center; gap: .5rem; background: var(--brand-light); border: 1px dashed var(--brand); border-radius: var(--radius-sm); padding: .5rem .7rem; }
.summary-row { display: flex; justify-content: space-between; padding: .3rem 0; }

/* Tom Select (searchable district / thana) */
.ts-wrapper .ts-control { border-radius: var(--radius-sm); min-height: 38px; padding: .375rem .75rem; }
.ts-wrapper.focus .ts-control { border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 20%, transparent); }
.ts-dropdown .active { background: var(--brand-light); color: var(--brand); }
.ts-dropdown .dropdown-input { border-radius: var(--radius-sm); }

/* Customer account */
.account-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #eef2ee; flex-shrink: 0; }
.account-avatar-lg { width: 88px; height: 88px; }
.min-w-0 { min-width: 0; }
.account-sidebar { position: sticky; top: 150px; }
.account-nav a, .account-nav button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .75rem; border-radius: var(--radius-sm); font-weight: 500; color: #333; background: none; border: 0; text-align: left; }
.account-nav a:hover, .account-nav button:hover { background: var(--brand-light); color: var(--brand); }
.account-nav a.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.account-nav button { color: #c62828; }
.account-title { font-size: 1.15rem; font-weight: 700; padding-bottom: .75rem; margin-bottom: 1rem; border-bottom: 1px solid #e5e5e5; }
.account-table th { width: 32%; font-weight: 500; color: #666; }
.account-stat { display: flex; align-items: center; gap: .8rem; background: var(--brand-light); border-radius: var(--radius); padding: .8rem 1rem; }
.account-stat i { font-size: 1.6rem; color: var(--brand); }
@media (max-width: 991.98px) { .account-sidebar { position: static; } }

/* Footer */
.site-footer { background: var(--footer-bg); color: var(--footer-text); }
.site-footer h6 { color: #fff; font-weight: 700; margin-bottom: .8rem; }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; }
.footer-logo { max-height: 50px; }
.footer-bottom { background: var(--footer-bottom); }

/* Floating side cart + slide-out cart */
.float-cart { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 1040; width: 82px; border-radius: var(--radius) 0 0 var(--radius); overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.2); border: 0; padding: 0; text-align: center; }
.float-cart .fc-top { background: var(--accent); color: var(--accent-contrast); padding: .5rem .25rem; font-size: .75rem; }
.float-cart .fc-top i { font-size: 1.4rem; display: block; }
.float-cart .fc-total { background: #fff; color: var(--accent-dark); font-weight: 700; font-size: .8rem; padding: .35rem .2rem; }
.float-cart.bump { animation: bump .45s ease; }
@keyframes bump { 30% { transform: translateY(-50%) scale(1.12); } }
@media (max-width: 575.98px) { .float-cart { width: 64px; } .float-cart .fc-total { font-size: .7rem; } }

.cart-drawer { --bs-offcanvas-width: 380px; }
.cart-drawer .offcanvas-header { background: var(--brand); color: var(--brand-contrast); }
.cart-drawer .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.drawer-item { display: flex; gap: .6rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid #eee; }
.drawer-item img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); }
.drawer-item .remove { border: 0; background: none; color: #c62828; }
.drawer-busy { opacity: .5; pointer-events: none; }

.toast-container { z-index: 1090; }

.whatsapp-float { position: fixed; right: 16px; bottom: 80px; width: 52px; height: 52px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; z-index: 1040; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.whatsapp-float:hover { color: #fff; }
@media (min-width: 992px) { .whatsapp-float { bottom: 24px; } }

.mobile-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; display: flex; justify-content: space-around; border-top: 1px solid #ddd; z-index: 1035; height: 58px; }
.mobile-bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .75rem; color: #333; flex: 1; }
.mobile-bottom-nav a.active, .mobile-bottom-nav a:hover { color: var(--brand); }
.mobile-bottom-nav i { font-size: 1.25rem; }
