/* DANAM MegaStore — component layer on top of the compiled Tailwind build. */

:root {
    --brand: #0f766e;          /* teal-700 */
    --brand-strong: #115e59;   /* teal-800 */
    --brand-tint: #f0fdfa;
    --ink: #0f172a;            /* slate-900 */
    --accent: #fbbf24;         /* amber-400 */
    --line-botanicals: #047857;
    --line-apparel: #b45309;
    --line-hardware: #1d4ed8;
    --hot: #be123c;
    --focus: #0d9488;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    color-scheme: light;
}

/* ---------- Browser surfaces ---------- */
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
html.scroll-locked { overflow: hidden; }
body { accent-color: var(--brand); caret-color: var(--brand); }
::selection { background: #99f6e4; color: var(--ink); }
* { scrollbar-color: #cbd5e1 transparent; }
a { text-underline-offset: 3px; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 6px;
}
.bg-slate-900 :focus-visible,
.bg-slate-950 :focus-visible,
.bg-teal-700:focus-visible { outline-color: var(--accent); }

[hidden] { display: none !important; }

.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 100;
    background: var(--ink); color: #fff; font-weight: 700; font-size: .875rem;
    padding: .75rem 1rem; border-radius: .75rem;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 44px; padding: .625rem 1.25rem; border-radius: .75rem;
    font-size: .875rem; font-weight: 700; line-height: 1.2; text-align: center;
    transition: background-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 6px -2px rgb(15 23 42 / .25); }
.btn-primary:hover:not(:disabled) { background: var(--brand-strong); }
.btn-secondary { background: #fff; color: #1f2937; border: 1px solid #d1d5db; }
.btn-secondary:hover:not(:disabled) { background: #f3f4f6; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #1e293b; }
.btn-accent { background: #b45309; color: #fff; }
.btn-accent:hover:not(:disabled) { background: #92400e; }

/* ---------- Badges ---------- */
.count-badge {
    min-width: 1.125rem; height: 1.125rem; padding: 0 .25rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: var(--accent); color: var(--ink);
    font-size: 11px; font-weight: 800; line-height: 1;
}
.count-badge.hidden { display: none; }

.line-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .5rem; border-radius: .375rem;
    font-size: 11px; font-weight: 700; line-height: 1.2; color: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / .12);
}
.line-badge i { font-size: 10px; }
.line-badge--lg { font-size: .8125rem; padding: .3rem .75rem; border-radius: 999px; }
.line-badge--botanicals { background: var(--line-botanicals); }
.line-badge--apparel { background: var(--line-apparel); }
.line-badge--hardware { background: var(--line-hardware); }
.line-badge--hot { background: var(--hot); }

/* ---------- Navigation ---------- */
.nav-link {
    display: flex; align-items: center; gap: .4rem;
    padding: .75rem .75rem; color: #e2e8f0; font-weight: 500;
    box-shadow: inset 0 -2px 0 transparent;
    transition: background-color .15s, color .15s, box-shadow .15s;
}
.nav-link:hover { color: #fff; background: #1e293b; }
.nav-link[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.line-dot { width: .5rem; height: .5rem; border-radius: 999px; display: inline-block; }

.mobile-link {
    display: flex; align-items: center; gap: .5rem; min-height: 48px;
    font-size: .9375rem; font-weight: 600; color: #374151;
}
.mobile-link:hover { color: var(--brand); }

/* ---------- Drawers & dialogs ---------- */
.drawer-backdrop, .modal-backdrop { opacity: 0; transition: opacity .2s ease; }
.drawer-backdrop.is-open, .modal-backdrop.is-open { opacity: 1; }
.drawer-panel { transition: transform .28s var(--ease-out); }
.drawer-panel--right { transform: translateX(100%); }
.drawer-panel--left { transform: translateX(-100%); }
.drawer-backdrop.is-open .drawer-panel { transform: none; }

.modal-enter { animation: modalScaleUp .3s var(--ease-out) both; }
@keyframes modalScaleUp { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Toasts ---------- */
.toast { transition: opacity .25s, transform .25s; }
.toast-enter { animation: toastIn .3s var(--ease-out) both; }
.toast-leave { opacity: 0; transform: translateY(8px); }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Product cards ---------- */
.product-card { transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 18px 30px -12px rgb(15 23 42 / .18); }
.product-card[data-source="DANAM Botanicals"]:hover { border-color: rgb(4 120 87 / .35); }
.product-card[data-source="DANAM Apparel"]:hover { border-color: rgb(180 83 9 / .35); }
.product-card[data-source="DANAM Hardware"]:hover { border-color: rgb(29 78 216 / .35); }
.card-img { transition: transform .5s var(--ease-out); }
.product-card:hover .card-img { transform: scale(1.06); }

/* Whole card is clickable via the title link; action buttons sit above it. */
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 10; border-radius: 1rem; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }

.card-action-btn {
    height: 2.25rem; display: inline-flex; align-items: center; justify-content: center;
    background: rgb(255 255 255 / .96); color: #1f2937; border-radius: .75rem;
    box-shadow: 0 4px 10px -4px rgb(15 23 42 / .3);
    transition: background-color .15s, color .15s;
}
.card-action-btn:hover { background: var(--brand); color: #fff; }
.wishlist-btn:hover { background: #fff1f2; color: var(--hot); }

/* Hover-reveal only where hover exists; touch devices always see the actions. */
@media (hover: hover) and (pointer: fine) {
    .card-actions { opacity: 0; transform: translateY(8px); transition: opacity .25s var(--ease-out), transform .25s var(--ease-out); }
    .product-card:hover .card-actions,
    .product-card:focus-within .card-actions { opacity: 1; transform: none; }
}
@media (hover: none), (pointer: coarse) {
    .card-actions { justify-content: flex-end; }
    .card-actions .card-action-btn:first-child { display: none; }  /* Quick view: tap the card instead */
}

.quick-add-btn { transition: background-color .15s, color .15s, transform .1s; }
.quick-add-btn:active { transform: scale(.92); }

.card-shine-container::after {
    content: ''; position: absolute; top: -50%; left: -70%; width: 45%; height: 200%;
    background: linear-gradient(to right, rgb(255 255 255 / 0), rgb(255 255 255 / .4), rgb(255 255 255 / 0));
    transform: rotate(30deg); opacity: 0; pointer-events: none;
}
.product-card:hover .card-shine-container::after { animation: shineSweep .85s var(--ease-out); }
@keyframes shineSweep { 0% { left: -70%; opacity: 0; } 30% { opacity: 1; } 100% { left: 140%; opacity: 0; } }

/* ---------- Hero ---------- */
.hero-slide { opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s linear .9s; }
.hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity .9s ease, visibility 0s; }
/* The first slide is visible even before JS runs or if the markup is older than this CSS. */
.hero-slide:first-child:not(.is-active):not([aria-hidden="true"]) { opacity: 1; visibility: visible; }
.slider-dot {
    width: 2.75rem; height: 2.75rem; display: inline-flex; align-items: center; justify-content: center;
}
.slider-dot::before {
    content: ""; width: .625rem; height: .625rem; border-radius: 999px; background: rgb(255 255 255 / .45);
    transition: width .3s var(--ease-out), background-color .3s;
}
.slider-dot:hover::before { background: rgb(255 255 255 / .75); }
.slider-dot[aria-current="true"]::before { width: 1.75rem; background: #fff; }

/* ---------- Forms ---------- */
.field-label { display: block; font-size: .8125rem; font-weight: 700; color: #374151; margin-bottom: .375rem; }
.field-label .req { color: var(--hot); }
.field-error { margin-top: .375rem; font-size: .8125rem; font-weight: 600; color: #be123c; }
[aria-invalid="true"] { border-color: #e11d48 !important; box-shadow: 0 0 0 3px rgb(225 29 72 / .12); }

.qty-stepper {
    display: inline-flex; align-items: center; border: 1px solid #d1d5db; border-radius: .75rem;
    background: #fff; overflow: hidden;
}
.qty-stepper button {
    width: 2.75rem; height: 2.75rem; display: inline-flex; align-items: center; justify-content: center;
    color: #374151; font-size: .8125rem;
}
.qty-stepper button:hover { background: #f3f4f6; }
.qty-stepper > span, .qty-stepper input {
    min-width: 2.5rem; text-align: center; font-weight: 700; font-size: .9375rem; font-variant-numeric: tabular-nums;
    border: 0; background: transparent;
}
.qty-stepper input { width: 3.25rem; -moz-appearance: textfield; }
.qty-stepper input::-webkit-inner-spin-button, .qty-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper--sm button { width: 2.25rem; height: 2.25rem; }
.qty-stepper--sm > span { min-width: 1.75rem; font-size: .875rem; }

/* ---------- Product detail ---------- */
.zoom-image-container { overflow: hidden; position: relative; }
@media (hover: hover) and (pointer: fine) { .zoom-image-container { cursor: zoom-in; } }
.zoom-image-container img { transition: transform .2s var(--ease-out), opacity .25s ease; }
.thumbnail-btn[aria-current="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(15 118 110 / .25); }

.tier-box { transition: background-color .25s, border-color .25s, box-shadow .25s; }
.tier-box-active { background: #fde68a; box-shadow: inset 0 -3px 0 #b45309; }

.product-tab[aria-selected="true"] { color: var(--brand-strong); background: #fff; border-color: var(--brand); }
.tab-content { animation: fadeInTab .3s var(--ease-out) both; }
@keyframes fadeInTab { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@keyframes qtyBounce { 50% { transform: scale(1.18); } }
.qty-bounce { animation: qtyBounce .25s var(--ease-out); }
.btn-add-success { background-color: #047857 !important; color: #fff !important; }

/* ---------- Footer ---------- */
.footer-heading { font-weight: 700; color: #fff; font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .875rem; }
.footer-link { color: #cbd5e1; }
.footer-link:hover { color: #5eead4; text-decoration: underline; }
.footer-icon {
    width: 3rem; height: 3rem; border-radius: .75rem; flex-shrink: 0; font-size: 1.25rem;
    display: flex; align-items: center; justify-content: center;
    background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .1);
}
.hub-chip { background: #1e293b; color: #e2e8f0; font-weight: 700; padding: .125rem .5rem; border-radius: .375rem; border: 1px solid #334155; }

/* ---------- Reduced motion: keep state changes, drop travel ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .product-card:hover, .product-card:hover .card-img { transform: none; }
    .card-shine-container::after { display: none; }
    .drawer-panel { transition: none; }
    .hero-slide, .hero-slide.is-active { transition: opacity .01s; }
    .modal-enter, .tab-content, .toast-enter, .qty-bounce { animation: none; }
    .animate-ping, .animate-pulse { animation: none; }
    .card-actions { transition: opacity .15s; transform: none !important; }
}

/* ---------- Print (invoices) ---------- */
@media print {
    header, footer, nav, #cartDrawer, #quickViewModal, #mobileDrawer, #toastContainer, .skip-link, .no-print { display: none !important; }
    body { background: #fff !important; color: #000 !important; font-size: 12pt; }
    .shadow-xl, .shadow-sm, .shadow { box-shadow: none !important; }
}
