/*
 * Custom visual layer on top of vendored Bootstrap 5. Admin-configurable
 * tokens (brand colors, logo) live in layouts/partials/theme-vars.blade.php;
 * everything here is the fixed "modern" structural styling (spacing, radius,
 * shadow, type) shared by the storefront and the admin panel.
 */

:root {
    --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --ink: #14161a;
    --ink-muted: #6b7078;
    --ink-faint: #9a9fa6;
    --surface: #ffffff;
    --surface-alt: #f7f6f4;
    --surface-sunken: #f1efec;
    --line: #eceae6;
    --line-strong: #dedbd6;

    --bs-body-color: var(--ink);
    --bs-body-bg: var(--surface-alt);
    --bs-border-color: var(--line);
    --bs-secondary-color: var(--ink-muted);

    --bs-border-radius-sm: .5rem;
    --bs-border-radius: .75rem;
    --bs-border-radius-lg: 1rem;
    --bs-border-radius-xl: 1.5rem;

    --shadow-xs: 0 1px 2px rgba(20, 22, 26, .04);
    --shadow-soft: 0 1px 2px rgba(20, 22, 26, .04), 0 4px 16px rgba(20, 22, 26, .06);
    --shadow-soft-lg: 0 8px 24px rgba(20, 22, 26, .08), 0 2px 6px rgba(20, 22, 26, .04);
    --shadow-lift: 0 16px 40px rgba(20, 22, 26, .12);

    --ease: cubic-bezier(.4, 0, .2, 1);

    --section-y: clamp(2.5rem, 5vw, 4.5rem);
}

/* =========================================================
   Base
   ========================================================= */

body {
    -webkit-font-smoothing: antialiased;
    color: var(--ink);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

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

a {
    text-decoration: none;
}

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

::selection {
    background: rgba(var(--bs-primary-rgb), .18);
}

/* Eyebrow / overline label used above section headings */
.eyebrow {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--bs-primary);
    margin-bottom: .5rem;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: clamp(1.375rem, 2vw, 1.75rem);
}

.section-heading .section-link {
    font-weight: 600;
    font-size: .9rem;
    color: var(--ink);
    white-space: nowrap;
}

.section-heading .section-link:hover {
    color: var(--bs-primary);
}

section + section,
.storefront-section + .storefront-section {
    margin-top: var(--section-y);
}

/* =========================================================
   Cards
   ========================================================= */

.card {
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
    border-radius: var(--bs-border-radius-lg);
    background: var(--surface);
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    font-weight: 600;
    border-radius: var(--bs-border-radius);
    padding-block: .6rem;
    padding-inline: 1.25rem;
    font-size: .925rem;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}

.btn-lg {
    padding-block: .85rem;
    padding-inline: 1.75rem;
    font-size: 1rem;
}

.btn-sm {
    padding-block: .4rem;
    padding-inline: .85rem;
    font-size: .825rem;
}

.btn-primary,
.btn-danger,
.btn-success,
.btn-dark {
    border: none;
}

.btn-primary:hover,
.btn-danger:hover,
.btn-success:hover,
.btn-dark:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.btn-dark {
    background: var(--ink);
    color: #fff;
}

.btn-dark:hover {
    background: #000;
    color: #fff;
}

.btn-outline-secondary {
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-outline-secondary:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
}

/* Pill-style filter/category chips */
.chip {
    display: inline-flex;
    align-items: center;
    padding: .4rem .9rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-size: .825rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}

.chip:hover,
.chip.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

/* =========================================================
   Forms
   ========================================================= */

.form-control,
.form-select {
    border-radius: var(--bs-border-radius);
    border-color: var(--line-strong);
    padding-block: .6rem;
    padding-inline: .9rem;
    background-color: var(--surface);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15);
}

.form-label {
    font-weight: 600;
    font-size: .875rem;
    margin-bottom: .4rem;
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* =========================================================
   Selectable option rows (checkout: address / shipping / payment)
   ========================================================= */

.option-row {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--bs-border-radius);
    padding: .9rem 1rem;
    margin-bottom: .6rem;
    cursor: pointer;
    transition: border-color .15s var(--ease), background-color .15s var(--ease);
}

.option-row:last-child {
    margin-bottom: 0;
}

.option-row:hover {
    border-color: var(--line-strong);
}

.option-row:has(.form-check-input:checked) {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), .04);
}

.option-row .form-check-input {
    margin-top: .2rem;
}

/* =========================================================
   Site header
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}

.site-header .navbar {
    padding-block: .85rem;
}

.site-header .navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.site-header .nav-icon-link {
    color: var(--ink);
    font-size: 1.2rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    transition: background-color .15s var(--ease);
}

.site-header .nav-icon-link:hover {
    background: var(--surface-sunken);
}

.site-header .nav-link-text {
    font-weight: 600;
    font-size: .925rem;
    color: var(--ink);
}

.site-header .nav-link-text:hover {
    color: var(--bs-primary);
}

.cart-count-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: .625rem;
    min-width: 1.1rem;
    height: 1.1rem;
    line-height: 1.1rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 700;
    text-align: center;
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
    position: relative;
    border-radius: var(--bs-border-radius-xl);
    background: linear-gradient(155deg, var(--surface-sunken) 0%, var(--surface-alt) 60%);
    overflow: hidden;
    padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4rem);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 15%, rgba(var(--bs-primary-rgb), .16), transparent 55%),
        radial-gradient(circle at 10% 90%, rgba(var(--bs-primary-rgb), .08), transparent 45%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 640px;
}

.hero-title {
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    line-height: 1.05;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    color: var(--ink-muted);
    margin-bottom: 2rem;
    max-width: 46ch;
}

/* Admin-configured banner carousel */
.hero-carousel {
    border-radius: var(--bs-border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-soft-lg);
}

.hero-carousel .carousel-item img {
    display: block;
    width: 100%;
    height: auto;
}

/* Trust / promo strip */
.promo-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    padding: 1.75rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.promo-item {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.promo-item .icon {
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-sunken);
    color: var(--bs-primary);
    font-size: 1.15rem;
}

.promo-item .title {
    font-weight: 700;
    font-size: .9rem;
    color: var(--ink);
}

.promo-item .desc {
    font-size: .8rem;
    color: var(--ink-muted);
}

/* =========================================================
   Category grid (homepage)
   ========================================================= */

.category-tile {
    position: relative;
    display: block;
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--surface-sunken);
    box-shadow: var(--shadow-xs);
    transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}

.category-tile:hover {
    box-shadow: var(--shadow-soft-lg);
    transform: translateY(-2px);
}

.category-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s var(--ease);
}

.category-tile:hover img {
    transform: scale(1.06);
}

.category-tile .placeholder-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-faint);
    font-size: 2rem;
}

.category-tile .label {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: .9rem .75rem .75rem;
    background: linear-gradient(0deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    font-weight: 700;
    font-size: .875rem;
    text-align: center;
}

/* =========================================================
   Product card
   ========================================================= */

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--bs-border-radius-lg);
    background: var(--surface);
    overflow: hidden;
    transition: box-shadow .22s var(--ease), transform .22s var(--ease), border-color .22s var(--ease);
}

.product-card:hover {
    box-shadow: var(--shadow-soft-lg);
    transform: translateY(-3px);
    border-color: var(--line-strong);
}

.product-card .media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--surface-sunken);
    overflow: hidden;
}

.product-card .media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--ease);
}

.product-card:hover .media img {
    transform: scale(1.07);
}

.product-card .media .placeholder-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-faint);
    font-size: 2rem;
}

.product-card .badge-tag {
    position: absolute;
    top: .65rem;
    left: .65rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
    padding: .3rem .6rem;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
}

.product-card .badge-tag.sale {
    background: #c2410c;
}

.product-card .body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card .name {
    font-size: .925rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .footer-row {
    margin-top: auto;
    padding-top: .6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.commerce-price .fw-bold {
    color: var(--ink);
}

/* =========================================================
   Badges
   ========================================================= */

.badge {
    font-weight: 600;
    padding: .4em .7em;
    border-radius: 999px;
}

/* =========================================================
   Alerts
   ========================================================= */

.alert {
    border: none;
    border-radius: var(--bs-border-radius);
}

/* =========================================================
   Auth / narrow-card pages
   ========================================================= */

.auth-shell {
    min-height: calc(100vh - 260px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-block: var(--section-y);
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

/* =========================================================
   Site footer
   ========================================================= */

.site-footer {
    background: var(--ink);
    color: rgba(255, 255, 255, .68);
    margin-top: var(--section-y);
}

.site-footer .footer-brand {
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.site-footer h6 {
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.site-footer a {
    color: rgba(255, 255, 255, .68);
    transition: color .15s var(--ease);
}

.site-footer a:hover {
    color: #fff;
}

.site-footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: .825rem;
    color: rgba(255, 255, 255, .5);
}

.payment-icons i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, .55);
}

/* =========================================================
   Utilities
   ========================================================= */

.shadow-soft {
    box-shadow: var(--shadow-soft) !important;
}

.shadow-soft-lg {
    box-shadow: var(--shadow-soft-lg) !important;
}

.bg-surface-alt {
    background-color: var(--surface-alt) !important;
}

.bg-surface-sunken {
    background-color: var(--surface-sunken) !important;
}
