/* =========================================================
   Storefront theme — minimal, modern e-commerce look.
   Loaded after styles.css by layouts/app.blade.php only
   (admin panel is unaffected).
   ========================================================= */

/* ===== DESIGN TOKENS ===== */
html:root {
    --primary-color: #111111;
    --secondary-color: #2d2d2d;
    --accent-color: #e4572e;
    --text-dark: #141414;
    --text-light: #6f6f6f;
    --bg-light: #f7f6f3;
    --bg-white: #ffffff;
    --border-color: #e9e6e0;
    --surface-muted: #f1efea;
    --transition: all 0.25s ease;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.05);
    --shadow-md: 0 8px 24px rgba(17, 17, 17, 0.08);
    --shadow-lg: 0 18px 40px rgba(17, 17, 17, 0.12);
    --shadow-xl: 0 24px 60px rgba(17, 17, 17, 0.16);
    --gradient-overlay: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.65) 100%);
    --gradient-primary: linear-gradient(135deg, #111111, #3a3a3a);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --container: 1280px;
}

/* ===== BASE ===== */
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

img {
    max-width: 100%;
}

::selection {
    background: #111111;
    color: #ffffff;
}

:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

/* ===== HEADER ===== */
.header {
    background-color: #ffffff;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: var(--container);
    padding: 0 1.5rem;
    min-height: 68px;
    gap: 2.5rem;
}

.logo {
    color: var(--text-dark);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    gap: 0.55rem;
}

.logo img {
    display: block;
    height: 36px;
    width: auto;
}

.nav-menu {
    justify-content: center;
    gap: 2.25rem;
}

.nav-menu li {
    padding: 24px 0;
}

.nav-link {
    padding: 24px 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #3b3b3b;
    letter-spacing: 0.01em;
}

.nav-link .nav-icon {
    font-size: 1rem;
    margin-right: 7px;
    color: #8d8a85;
    transition: color 0.2s ease;
}

.nav-link:hover .nav-icon {
    color: var(--accent-color);
}

.nav-link .nav-caret {
    font-size: 0.65rem;
    margin-left: 3px;
    opacity: 0.6;
}

.drawer-menu .nav-icon {
    width: 22px;
    text-align: center;
    font-size: 1.15rem;
    color: #8d8a85;
}

.drawer-menu-link:hover .nav-icon {
    color: var(--accent-color);
}

.nav-link:hover,
.nav-link:active {
    color: var(--text-dark);
}

.nav-link::after {
    bottom: 16px;
    height: 1.5px;
    background-color: var(--text-dark);
}

.nav-icons {
    gap: 0.35rem;
}

.icon-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.icon-link:hover {
    color: var(--text-dark);
    background-color: var(--surface-muted);
    transform: none;
}

.cart-count {
    top: 2px;
    right: 1px;
    min-width: 18px;
    width: auto;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background-color: var(--accent-color);
    border: 2px solid #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

/* ===== SEARCH BAR ===== */
.search-bar {
    background-color: transparent;
    border-top: none;
    padding: 0 1.5rem 0.9rem;
}

.search-container {
    max-width: var(--container);
    position: relative;
    gap: 0;
}

.search-input-field {
    padding: 0.8rem 3.5rem 0.8rem 1.25rem;
    background-color: var(--surface-muted);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.92rem;
    color: var(--text-dark);
}

.search-input-field::placeholder {
    color: #8d8a85;
}

.search-input-field:focus {
    background-color: #ffffff;
    border-color: #111111;
    box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.06);
}

.search-submit-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    background-color: #111111;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-submit-btn:hover {
    background-color: #333333;
    transform: translateY(-50%);
}

/* ===== HAMBURGER ===== */
.hamburger-menu {
    width: 40px;
    height: 40px;
    gap: 5px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.hamburger-menu:hover {
    background-color: var(--surface-muted);
}

.hamburger-menu span {
    width: 20px;
    height: 2px;
}

/* ===== DRAWER MENU ===== */
.drawer-overlay {
    background: rgba(17, 17, 17, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.drawer-menu {
    width: 300px;
    max-width: 85vw;
    box-shadow: var(--shadow-xl);
}

.drawer-header {
    padding: 1.25rem 1.5rem;
}

.drawer-header h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-light);
}

.drawer-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    line-height: 1;
}

.drawer-close-btn:hover {
    color: var(--text-dark);
    background-color: var(--surface-muted);
    transform: none;
}

.drawer-menu-list li {
    border-bottom: 1px solid #f0eee9;
}

.drawer-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
}

.drawer-menu-link:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
    padding-left: 1.75rem;
}

/* ===== USER DROPDOWN ===== */
.user-dropdown-menu {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 230px;
    overflow: hidden;
}

.dropdown-header {
    padding: 0.9rem 1.25rem;
    background: var(--bg-light);
}

.dropdown-link {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
}

.dropdown-link:hover {
    color: var(--text-dark);
    background-color: var(--bg-light);
    padding-left: 1.5rem;
}

.dropdown-link i {
    color: var(--text-light);
}

.logout-link,
.logout-link i {
    color: #c0392b;
}

.logout-link:hover {
    background-color: #fdf0ee;
    color: #c0392b;
}

/* ===== BUTTONS ===== */
.btn,
.add-to-cart-btn,
.newsletter-form button {
    border-radius: 999px;
}

.btn-primary:hover,
.add-to-cart-btn:hover,
.newsletter-form button:hover {
    background-color: #333333;
}

.pagination button {
    border-color: var(--border-color);
    border-radius: var(--radius-sm);
    min-width: 38px;
}

.badge {
    border-radius: 999px;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    background-color: #111111;
}

.badge.sale {
    background-color: var(--accent-color);
}

/* ===== ALERT MODAL ===== */
.alert {
    background: rgba(17, 17, 17, 0.45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.alert-box {
    position: relative;
    padding: 2rem 1.75rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.alert-title {
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}

.alert-body {
    color: var(--text-light);
    font-size: 0.95rem;
}

.alert-button {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    background: #111111;
    border-radius: 999px;
    font-weight: 600;
}

.alert-button:hover {
    background: #333333;
}

/* ===== FOOTER ===== */
.footer {
    background-color: #111111;
    color: #bdbab4;
    padding: 72px 24px 0;
    margin-top: 0;
}

.footer-container {
    max-width: var(--container);
    gap: 48px 40px;
    padding-bottom: 56px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-section h4 {
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    margin-bottom: 18px;
}

.footer-section p,
.footer-section ul li,
.product-list li,
.benefits-list li,
.policy-list li {
    color: #a9a59e;
    font-size: 0.86rem;
}

.footer-section strong {
    color: #e8e5df;
    font-weight: 600;
}

.footer-section a,
.footer-section ul li a {
    color: #d4d0c9;
    text-decoration: none;
}

.footer-section a:hover,
.footer-section ul li a:hover {
    color: #ffffff;
    font-weight: inherit;
}

.social-links a {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.9rem;
}

.social-links a:hover {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #111111;
}

.footer-bottom {
    background-color: #0b0b0b;
    padding: 28px 24px;
}

.footer-bottom-content {
    max-width: var(--container);
}

.footer-bottom p {
    color: #8e8a83;
    font-size: 0.8rem;
}

.footer-bottom p strong {
    color: #e8e5df;
}

.footer-bottom a {
    color: #d4d0c9;
}

.footer-bottom a:hover {
    color: #ffffff;
}

/* layout-level footer shown on inner pages */
.footer-bottom2 {
    margin-top: 64px;
    padding: 40px 24px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .navbar {
        padding: 0;
    }

    .nav-container {
        padding: 0 0.75rem;
        min-height: 60px;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1.15rem;
    }

    .logo img {
        height: 30px;
    }

    .nav-icons {
        gap: 0;
    }

    .search-bar {
        padding: 0 0.75rem 0.75rem;
        max-height: 80px;
        overflow: hidden;
        transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
    }

    /* Search row tucks away while scrolling down, returns on scroll up */
    .header.is-compact .search-bar {
        max-height: 0;
        padding-bottom: 0;
        opacity: 0;
    }

    .logo {
        padding: 6px 0;
    }

    .search-input-field {
        padding: 0.7rem 3.25rem 0.7rem 1.1rem;
        font-size: 0.9rem;
    }

    .search-submit-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {

    /* 16px text stops iPhones from zooming in when a field is tapped */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    .footer {
        padding: 48px 20px 0;
    }

    .footer-container {
        gap: 32px 24px;
    }

    .footer-section h4 {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .logo img {
        height: 26px;
    }

    .icon-link {
        width: 36px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   HEADER LAYOUT — search in the top row, menu in its own row
   ========================================================= */
.nav-container {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "logo search icons";
    align-items: center;
    gap: 2rem;
    min-height: 72px;
}

.hamburger-menu {
    grid-area: burger;
}

.logo {
    grid-area: logo;
}

.nav-icons {
    grid-area: icons;
    justify-self: end;
}

.nav-container .search-bar {
    grid-area: search;
    width: 100%;
    max-width: 680px;
    justify-self: center;
    padding: 0;
    background: transparent;
}

.nav-container .search-container {
    max-width: none;
}

/* Menu row: segmented navigation (Home · Mens · Women · Girl · Boy · Category) + About Us */
.nav-menu-row {
    border-top: 1px solid var(--border-color);
    padding: 10px 0;
}

.nav-segment-wrap {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.nav-segmented {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    margin: 0;
    list-style: none;
    background: #f1f1f1;
    border-radius: 14px;
}

.nav-segmented > li {
    position: relative;
}

.seg-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 96px;
    padding: 9px 22px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #3b3b3b;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.seg-link:hover {
    background: #ffffff;
    color: #111111;
}

.seg-link.is-active,
.seg-link.is-active:hover {
    background: #111111;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(17, 17, 17, 0.18);
}

.seg-link:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

.seg-link .nav-caret {
    font-size: 0.65rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.seg-category.open .seg-link .nav-caret,
.seg-category:hover .seg-link .nav-caret {
    transform: rotate(180deg);
}

.nav-plain-link {
    color: #3b3b3b;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    padding: 9px 4px;
}

.nav-plain-link:hover {
    color: #111111;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Category dropdown under the segment (hover or click on desktop) */
.nav-menu-row .seg-category .sub-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    column-gap: 4px;
    min-width: 470px;
    max-height: none;
    overflow: visible;
    padding: 10px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(17, 17, 17, 0.12);
    opacity: 0;
    transform: translate(-50%, 8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Hover bridge so the pointer can travel from the button to the panel */
.nav-menu-row .seg-category .sub-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
}

.nav-menu-row .seg-category:hover .sub-menu,
.nav-menu-row .seg-category.open .sub-menu {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

/* Line icons beside each menu label (white on the black active segment via currentColor) */
.seg-link .seg-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.nav-segmented .seg-link {
    gap: 8px;
    padding: 9px 20px;
}

.drawer-menu .seg-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #8d8a85;
    transition: color 0.2s ease;
}

.drawer-menu-link:hover .seg-icon,
.nav-link-drawer:hover .seg-icon {
    color: var(--accent-color);
}

@media (max-width: 1240px) {
    .nav-segmented .seg-link {
        padding: 9px 14px;
    }
}

@media (max-width: 1100px) {
    .seg-link {
        min-width: 0;
        padding: 9px 16px;
    }

    .nav-segmented .seg-link {
        gap: 6px;
        padding: 9px 12px;
    }
}

/* Phones & tablets: menu lives in the drawer; search gets its own row */
@media (max-width: 992px) {
    .nav-container {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-rows: 60px auto;
        grid-template-areas:
            "burger logo icons"
            "search search search";
        gap: 0 0.5rem;
        min-height: 0;
    }

    .logo {
        justify-self: start;
    }

    .nav-container .search-bar {
        max-width: none;
        padding: 0 0 0.75rem;
    }

    /* Segmented menu scrolls sideways under the search bar */
    .nav-menu-row {
        border-top: none;
        padding: 0 0 10px;
        max-height: 80px;
        overflow: hidden;
        transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
    }

    .nav-segment-wrap {
        justify-content: flex-start;
        justify-content: safe center; /* centred when it fits, scrolls from the start when it doesn't */
        padding: 0 0.75rem;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .nav-segment-wrap::-webkit-scrollbar {
        display: none;
    }

    .nav-segmented {
        flex-shrink: 0;
    }

    .seg-link,
    .nav-segmented .seg-link {
        min-width: 0;
        min-height: 40px;
        padding: 8px 14px;
        scroll-snap-align: start;
    }

    .seg-link .seg-icon {
        width: 19px;
        height: 19px;
    }

    .nav-menu-row .seg-category .sub-menu {
        display: none; /* phones: Category opens the menu drawer instead */
    }

    .nav-plain-link {
        flex-shrink: 0;
        padding-right: 0.75rem;
    }

    /* Compact header while scrolling down: only the top row stays */
    .header.is-compact .nav-menu-row {
        max-height: 0;
        padding-bottom: 0;
        opacity: 0;
    }
}

/* Phones: all six items in one row as app-style tabs (icon above label), no sideways scrolling.
   About Us lives in the menu drawer; Category opens the drawer with categories expanded. */
@media (max-width: 600px) {
    .nav-menu-row {
        padding: 0 0 8px;
    }

    .nav-segment-wrap {
        overflow: visible;
        padding: 0 0.6rem;
        scroll-snap-type: none;
    }

    .nav-segmented {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        width: 100%;
        gap: 2px;
        padding: 3px;
        border-radius: 14px;
    }

    .nav-segmented .seg-link {
        width: 100%;
        min-height: 52px;
        flex-direction: column;
        gap: 3px;
        padding: 6px 2px 5px;
        border-radius: 11px;
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.01em;
        line-height: 1.1;
    }

    .nav-segmented .seg-link .seg-icon {
        width: 21px;
        height: 21px;
    }

    .nav-segmented .seg-link span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-segmented .seg-link .nav-caret {
        display: none;
    }

    .nav-plain-link {
        display: none;
    }
}

@media (max-width: 360px) {
    .nav-segmented .seg-link {
        font-size: 0.62rem;
    }

    .nav-segmented .seg-link .seg-icon {
        width: 19px;
        height: 19px;
    }
}
