/*
 |-----------------------------------------------------------------------------
 | Codzshop - shared UI
 |-----------------------------------------------------------------------------
 | One stylesheet for the whole storefront, cached across every page. Colours
 | are never written literally here: every one comes from a token defined in
 | partials/theme.blade.php, so light and dark mode stay in sync and a
 | page can never half-switch.
 |
 | No webfonts, no framework, no JS-driven layout - the Bengali system font is
 | already on the device and one cached file beats a font handshake on 3G.
 */

/* ---------------------------------------------------------------- reset --- */

*, *::before, *::after { box-sizing: border-box; }

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }

ul[class], ol[class] { list-style: none; padding: 0; }

img, svg, video { display: block; max-width: 100%; }

img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

/* ----------------------------------------------------------------- base --- */

html {
    background: var(--bg-solid);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    /* Room for the fixed bottom nav so the last element is never trapped. */
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }

/* Section headings and product captions use the display face; body copy stays
   on the system stack so Bengali text renders with the device font. */
.display { font-family: var(--font-display); font-weight: 400; color: var(--heading); }

h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

p { color: var(--text-muted); }

strong { color: var(--text); font-weight: 600; }

hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

::selection { background: var(--accent); color: var(--text-on-accent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Anything anchored to via a #hash clears the sticky header. */
[id] { scroll-margin-top: 72px; }

/* --------------------------------------------------------------- layout --- */

.wrap {
    width: 100%;
    max-width: 1220px;
    margin-inline: auto;
    padding-inline: 8px;
}

/* The storefront's content column: 8px page gutter, 1220px centred inside. */
.page { padding: 8px; }

.cx { width: 100%; max-width: 1220px; margin-inline: auto; }

.wrap-sm { max-width: 620px; }

.stack > * + * { margin-top: 14px; }

.center { text-align: center; }

.muted { color: var(--text-muted); }

.small { font-size: .85rem; }

/* --------------------------------------------------------------- header --- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: 1220px;
    margin-inline: auto;
    padding: 12px 8px;
    /* 42px content row + 12px padding either side = the reference header. */
    min-height: 66px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -.02em;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

/* Desktop nav. On mobile the same destinations live in the bottom bar, so this
   is hidden rather than duplicated into a burger menu nothing else needs. */
.main-nav { display: none; }

.main-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: .92rem;
    color: var(--text-muted);
    transition: color .2s, background .2s;
}

.main-nav a:hover { color: var(--text); background: var(--surface-2); }

.main-nav a.active { color: var(--accent); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* Theme toggle -------------------------------------------------------- */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    transition: background .2s, border-color .2s;
}

.theme-toggle:hover { background: var(--surface-3); border-color: var(--border-strong); }

.theme-toggle svg { width: 19px; height: 19px; }

/* Show the icon for the theme you would switch *to*. */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.account-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
}

.account-row svg { width: 18px; height: 18px; stroke: var(--text-muted); }

.profile-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-strong);
}

/* ---------------------------------------------------------- bottom nav --- */

.bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 99;
    display: flex;
    justify-content: space-around;
    background: var(--nav-bg);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

.bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
    color: var(--text-faint);
    font-size: .68rem;
    font-weight: 600;
    transition: color .2s;
}

.bottom-nav .nav-item svg { width: 22px; height: 22px; }

.bottom-nav .nav-item:hover { color: var(--text); }

.bottom-nav .nav-item.active { color: var(--accent); }

.nav-icon { position: relative; display: flex; }

.badge {
    position: absolute;
    top: -5px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: var(--danger-on);
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

/* ---------------------------------------------------------------- card --- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 14px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.card-title { font-size: 1rem; font-weight: 700; color: var(--text); }

/* Legacy alias: several pages still mark their glass panels as .panelData. */
.panelData {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

/* -------------------------------------------------------------- buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    transition: filter .2s, background .2s, border-color .2s;
}

.btn:hover { filter: brightness(1.06); }

.btn:active { transform: translateY(1px); }

.btn:disabled, .btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
    filter: none;
}

.btn-primary { background: var(--cta-grad); color: var(--cta-on); }

.btn-accent { background: var(--accent); color: var(--text-on-accent); }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }

.btn-danger { background: var(--danger); color: var(--danger-on); }

.btn-sm { width: auto; padding: 8px 14px; font-size: .85rem; border-radius: 8px; }

/* ---------------------------------------------------------------- form --- */

.field { margin-bottom: 14px; }

.label {
    display: block;
    margin-bottom: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input, input[type="text"], input[type="number"], input[type="email"],
input[type="tel"], input[type="password"], input[type="search"], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
}

textarea { min-height: 96px; resize: vertical; }

.input:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

::placeholder { color: var(--text-faint); opacity: 1; }

select {
    appearance: none;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

.help { font-size: .78rem; color: var(--text-faint); margin-top: 5px; }

.error { font-size: .78rem; color: var(--danger); margin-top: 5px; }

/* --------------------------------------------------------------- pills --- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.pill-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.pill-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: transparent; }
.pill-warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.pill-info    { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* --------------------------------------------------------------- stars --- */

.stars { display: inline-flex; gap: 2px; line-height: 1; }
.star { color: var(--star); font-size: 14px; }
.star.empty { color: var(--text-faint); }

/* --------------------------------------------------------------- modal --- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: var(--overlay);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.modal.show { display: flex; }

.modal-box {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 18px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 22px;
    line-height: 1;
    color: var(--text-faint);
    background: none;
    border: 0;
}

.close-btn:hover { color: var(--text); }

.btn-google-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
    padding: 11px 16px;
    border-radius: 10px;
    background: var(--google-bg);
    color: var(--google-fg);
    border: 1px solid var(--border-strong);
    font-weight: 600;
}

.google-icon { width: 18px; height: 18px; }

/* -------------------------------------------------------------- loader --- */

#pageLoader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
}

#pageLoader.show { display: flex; }

#pageLoader .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------- social links --- */

.social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    transition: transform .2s;
}

.social-links a:hover { transform: translateY(-3px); }

.social-links svg { width: 22px; height: 22px; fill: var(--on-brand-icon); }

.social-links .telegrams { background: #229ed9; }
.social-links .facebook  { background: #1877f2; }
.social-links .whatsapps { background: #25d366; }
.social-links .youtube   { background: #e60000; }

/* --------------------------------------------------------- notice bar --- */

.notice-bar { padding: 8px 8px 0; }

.notice-inner {
    max-width: 1220px;
    margin-inline: auto;
    padding: 4px 8px;
    background: var(--notice-bg);
    color: var(--notice-fg);
    font-size: 1rem;
    line-height: 1.5;
}

.notice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.notice-bar strong { color: inherit; font-weight: 700; }

.notice-text { margin-top: 4px; font-size: .82rem; line-height: 1.5; color: inherit; }

.notice-close {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: inherit;
    font-size: 17px;
    line-height: 1;
}

.notice-close:hover { background: rgba(255, 255, 255, .3); }

/* -------------------------------------------------------------- footer --- */

.site-footer {
    margin-top: 20px;
    padding: 32px 8px 0;
    background: var(--footer-bg);
    color: var(--footer-fg);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    max-width: 1220px;
    margin-inline: auto;
    padding-bottom: 32px;
}

.footer-title {
    margin-bottom: 12px;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--footer-heading);
}

.site-footer p { color: var(--footer-muted); font-size: .84rem; line-height: 1.7; }

.site-footer ul { list-style: none; padding: 0; display: grid; gap: 7px; }

.site-footer li, .site-footer a { color: var(--footer-muted); font-size: .85rem; }

.site-footer a:hover { color: var(--footer-fg); }

.footer-social { display: flex; gap: 10px; margin-top: 14px; }

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--footer-line);
    color: var(--footer-fg);
    transition: background .2s, border-color .2s;
}

.footer-social a:hover { background: var(--footer-line); }

.footer-social svg { width: 17px; height: 17px; }

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #000;
    color: #fff;
    border: 1px solid var(--footer-line);
}

.store-badge svg { width: 24px; height: 24px; }
.store-badge span { display: grid; line-height: 1.2; font-size: 1.05rem; font-weight: 600; }
.store-badge small { font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }

.support-row {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--footer-line);
    border-radius: 10px;
    transition: background .2s;
}

.support-row:hover { background: var(--footer-line); }

.support-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--footer-line);
    color: var(--footer-fg);
}

.support-icon svg { width: 18px; height: 18px; }

.support-text { display: grid; min-width: 0; font-size: .78rem; color: var(--footer-muted); }
.support-text strong { font-size: .85rem; font-weight: 600; color: var(--footer-fg); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 16px;
    padding: 20px;
    border-top: 1px solid var(--footer-line);
    font-size: .875rem;
    color: var(--footer-legal);
    text-align: center;
}

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: 1.3fr 1fr 1.2fr; gap: 32px; padding-block: 8px 32px; }
    .footer-center { text-align: center; }
    .footer-center .store-badge { margin-inline: auto; }
    /* Stays centred rather than space-between: the right-hand item would sit
       underneath the floating help pill. */
    .footer-bottom { padding-inline: 90px; }
}

/* ---------------------------------------------------------- help float --- */

.help-float {
    position: fixed;
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    z-index: 98;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-label {
    padding: 7px 12px;
    border-radius: 8px;
    /* Fixed red in both themes: this is an attention control, so it should not
       soften into the pink that --danger becomes on the dark palette. */
    background: #d92b3f;
    color: #ffffff;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

.help-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--cta-grad);
    color: var(--cta-on);
    box-shadow: var(--shadow);
}

.help-icon svg { width: 21px; height: 21px; }

@media (min-width: 768px) {
    .help-float { bottom: 20px; right: 20px; }
}

/* ----------------------------------------------------------- pagination --- */

.pagination, .pagination ul { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; list-style: none; padding: 0; }

.pagination a, .pagination span, .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
}

.pagination .active span, .pagination [aria-current="page"] {
    background: var(--accent);
    border-color: transparent;
    color: var(--text-on-accent);
}

/* --------------------------------------------------------------- table --- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }

table.data th, table.data td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data th { color: var(--text-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }

/* ----------------------------------------------------------------- faq --- */

.faq details {
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.faq details:last-child { border-bottom: 0; }

.faq summary {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: .92rem;
    color: var(--text);
    list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
    content: "+";
    color: var(--accent);
    font-size: 1.1rem;
    line-height: 1;
    flex: 0 0 auto;
}

.faq details[open] summary::after { content: "\2212"; }

.faq summary h3 { display: inline; font-size: inherit; font-weight: inherit; }

.faq details p { margin-top: 8px; font-size: .88rem; }

/* ------------------------------------------------------------ breadcrumb --- */

.crumbs {
    max-width: 560px;
    margin-inline: auto;
    padding: 14px 14px 0;
    font-size: .78rem;
    color: var(--text-faint);
}

.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 5px; }
.crumbs .current { color: var(--text); }

/* --------------------------------------------------------- link chips --- */

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
    padding: 8px 13px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 600;
    transition: color .2s, border-color .2s;
}

.chip:hover { color: var(--accent); border-color: var(--accent); }

/* --------------------------------------------------------------- prose --- */

.prose h2 { margin: 22px 0 8px; font-size: 1.05rem; }
.prose h3 { margin: 18px 0 6px; font-size: .95rem; }
.prose p, .prose li { color: var(--text-muted); font-size: .92rem; }
.prose ul, .prose ol { margin: 8px 0 8px 20px; }
.prose li { margin-bottom: 5px; }
.prose a { color: var(--accent); text-decoration: underline; }

/* ------------------------------------------------------------- desktop --- */

@media (min-width: 768px) {
    body { font-size: 16px; padding-bottom: 24px; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.3rem; }
    .nav-container { padding: 20px 8px; }
    .notice-inner { padding: 12px 20px; }
    .main-nav { display: flex; gap: 4px; }
    .bottom-nav { display: none; }
    .card { padding: 20px; }
}

/* Users who ask for less motion get none of it. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
