/* ==========================================
   GOOGLE FONTS
========================================== */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Work+Sans:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    --bg: #f4f4f2;
    --surface: #ffffff;
    --ink: #111111;
    --ink-soft: #555555;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #131311;
    --surface: #1d1d1a;
    --ink: #ededE7;
    --ink-soft: #a3a49a;
    color-scheme: dark;
}

/* ==========================================
   RESET
========================================== */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    font-family:'Work Sans',sans-serif;
    background:var(--bg);
    color:var(--ink);
    line-height:1.6;
    -webkit-font-smoothing:antialiased;
}

img{
    display:block;
    width:100%;
}

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

button{
    cursor:pointer;
    border:none;
    font-family:'Work Sans',sans-serif;
}

main{
    width:92%;
    max-width:1300px;
    margin:50px auto;
}

/* ==========================================
   NAVBAR
========================================== */
nav{
    position:sticky;
    top:0;
    z-index:1000;
    background:#111;
    border-bottom:2px solid var(--ink);
}

nav .nav-container{
    max-width:1300px;
    margin:auto;
    height:75px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:0 25px;
}

.logo{
    display:flex;
    align-items:center;
}

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

.nav-links{
    display:flex;
    align-items:center;
    gap:30px;
}

.nav-links a{
    color:white;
    font-family:'Space Mono',monospace;
    font-size:13px;
    text-transform:uppercase;
    position:relative;
    transition:.3s;
}

.nav-links a::after{
    content:"";
    position:absolute;
    left:0;
    bottom:-6px;
    width:0;
    height:2px;
    background:#2563eb;
    transition:.3s;
}

.nav-links a:hover::after{
    width:100%;
}

.nav-right{
    display:flex;
    align-items:center;
    gap:15px;
}

.theme-toggle{
    display:flex;
    align-items:center;
    justify-content:center;
    width:36px;
    height:36px;
    background:transparent;
    border:2px solid #333;
    border-radius:15px;
    color:#ddd;
    font-size:15px;
}

.theme-toggle:hover{
    border-color:#ddd;
}

.nav-auth{
    display:flex;
    align-items:center;
    gap:12px;
}

/* Avatar button + its Profile/Logout dropdown, shown once a shopper is
   signed in — replaces the plain email + Logout button. */
.profile-menu{
    position:relative;
}

.avatar-btn{
    width:38px;
    height:38px;
    border-radius:50%;
    background:#2563eb;
    color:white;
    font-family:'Space Mono',monospace;
    font-size:14px;
    font-weight:bold;
    display:flex;
    align-items:center;
    justify-content:center;
    border:2px solid #333;
}

.avatar-btn:hover{
    border-color:white;
}

.profile-dropdown{
    position:absolute;
    top:50px;
    right:0;
    min-width:200px;
    background:var(--surface);
    color:var(--ink);
    border:2px solid var(--ink);
    border-radius:12px;
    overflow:hidden;
    z-index:1000;
}

.profile-dropdown-email{
    padding:14px 16px;
    font-family:'Space Mono',monospace;
    font-size:12px;
    color:var(--ink-soft);
    border-bottom:1px solid var(--bg);
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.profile-dropdown-item{
    display:block;
    width:100%;
    padding:13px 16px;
    text-align:left;
    background:none;
    color:var(--ink);
    font-family:'Space Mono',monospace;
    font-size:13px;
}

.profile-dropdown-item:hover{
    background:#2563eb;
    color:white;
}

/* Cart link needs its own stacking context so the badge can float at its
   top-right corner without pushing the other nav links out of line. */
.cart-link{
    padding-right:6px;
}

.cart-count{
    position:absolute;
    top:-9px;
    right:-2px;
    min-width:16px;
    height:16px;
    padding:0 3px;
    border-radius:50%;
    border:2px solid #111;
    display:flex;
    justify-content:center;
    align-items:center;
    background:#2563eb;
    color:white;
    font-size:10px;
    font-weight:bold;
    font-family:'Space Mono',monospace;
    line-height:1;
}

/* Dark mode keeps the nav bar black regardless of theme, but the badge's
   border needs to match so it still reads as "cut into" the nav. */
[data-theme="dark"] .cart-count{
    border-color:#111;
}

/* ==========================================
   BUTTONS
========================================== */
.btn{
    display:inline-flex;
    justify-content:center;
    align-items:center;
    padding:14px 28px;
    border:2px solid var(--ink);
    border-radius:20px;
    background:#111;
    color:white;
    font-family:'Space Mono',monospace;
    text-transform:uppercase;
    font-size:12px;
    letter-spacing:1px;
    transition:.25s;
}

.btn:hover{
    transform:translate(-3px,-3px);
}

.btn-primary{
    background:#2563eb;
    border-color:#2563eb;
}

.btn-primary:hover{
    background:#1d4ed8;
}

.btn-outline{
    background:var(--surface);
    color:var(--ink);
}

.btn-outline:hover{
    background:#111;
    color:white;
}

/* ==========================================
   HERO
========================================== */
.hero{
    min-height:92vh;
    display:grid;
    grid-template-columns:1fr 1fr;
    align-items:center;
    gap:60px;
    max-width:1300px;
    margin:auto;
    padding:70px 30px;
}

.hero-text h1{
    font-family:'Anton',sans-serif;
    font-size:clamp(60px,8vw,105px);
    line-height:0.95;
    text-transform:uppercase;
}

.hero-text span{
    color:#2563eb;
}

.hero-text p{
    margin:30px 0;
    font-size:18px;
    max-width:550px;
    color:var(--ink-soft);
}

.hero-buttons{
    display:flex;
    gap:20px;
    flex-wrap:wrap;
}

.hero-image{
    overflow:hidden;
    border:3px solid var(--ink);
    border-radius: 25px;
    background:var(--surface);
}

.hero-image img{
    aspect-ratio:4/5;
    object-fit:cover;
    transition:.4s;
}

.hero-image:hover img{
    transform:scale(1.05);
}

/* ==========================================
   ANNOUNCEMENT BAR
========================================== */
.announcement{
    background:#111;
    color:white;
    overflow:hidden;
    white-space:nowrap;
    padding:12px 0;
    border-top:2px solid var(--ink);
    border-bottom:2px solid var(--ink);
}

.announcement-track{
    display:inline-block;
    animation:scroll 10s linear infinite;
    font-family:'Space Mono',monospace;
    text-transform:uppercase;
    font-size:13px;
    letter-spacing:2px;
}

.announcement-track span{
    margin:0 40px;
}

@keyframes scroll{
    from{
        transform:translateX(0);
    }
    to{
        transform:translateX(-50%);
    }
}

/* ==========================================
   SHOP HEADER
========================================== */
.shop-header {
    margin-bottom: 40px;
}

.shop-header h1 {
    font-family: "Anton", sans-serif;
    font-size: clamp(42px, 6vw, 70px);
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 10px;
}

.shop-header p {
    font-size: 18px;
    color:var(--ink-soft);
    max-width: 600px;
}

/* ==========================================
   SEARCH
========================================== */
.search-section {
    margin-bottom: 30px;
}

#search {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--ink);
    border-radius: 20px;
    background:var(--surface);
    font-size: 16px;
    font-family: "Work Sans", sans-serif;
    transition: 0.3s;
}

#search:focus {
    outline: none;
    border-color: #2563eb;
}

/* ==========================================
   CATEGORY BUTTONS
========================================== */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.category-btn {
    padding: 12px 22px;
    border: 2px solid var(--ink);
    border-radius: 20px;
    background:var(--surface);
    color:var(--ink);
    font-family: "Space Mono", monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
}

.category-btn:hover {
    background: #111;
    color: white;
}

.category-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* ==========================================
   PRODUCT GRID
========================================== */
#products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: var(--surface);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 12px;
    font-family: "Space Mono", monospace;
    font-size: 13px;
}

.page-btn:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.page-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.page-btn:disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ==========================================
   PRODUCT CARD
========================================== */
.product-card {
    background:var(--surface);
    border: 2px solid var(--ink);
    border-radius: 25px;
    transition: 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow:8px 8px 0 var(--ink);
}

.product-card img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-bottom: 2px solid var(--ink);
    transition: 0.4s;
}

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

.product-info {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 10px;
    background: #2563eb;
    color: white;
    font-family: "Space Mono", monospace;
    font-size: 11px;
    text-transform: uppercase;
    width: fit-content;
}

.product-card h3 {
    font-family: "Anton", sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.product-card p {
    color:var(--ink-soft);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-family: "Space Mono", monospace;
    font-size: 22px;
    font-weight: bold;
    color: #2563eb;
}

.add-cart-btn {
    padding: 12px 18px;
    border: none;
    background: #111;
    border-radius: 20px;
    color: white;
    font-family: "Space Mono", monospace;
    font-size: 12px;
    text-transform: uppercase;
    transition: 0.3s;
}

.add-cart-btn:hover {
    background: #2563eb;
}

/* ==========================================
   HOME PAGE SECTIONS
   Section header + category tiles + the Fresh Drops product grid.
   Reuses the same tokens/accent as the rest of the site so it reads as
   part of the same design, not a bolted-on block.
========================================== */

.section {
    padding: 70px 0;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--ink);
}

.section-head h2 {
    font-family: "Anton", sans-serif;
    font-size: clamp(30px, 4vw, 44px);
    text-transform: uppercase;
}

.category-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
}

.category-tile {
    background: var(--surface);
    border: 1px solid var(--ink);
    border-radius: 25px;
    color: var(--ink);
    padding: 30px 20px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: 0.3s;
}

.category-tile:hover {
    background: #2563eb;
    color: white;
}

.category-tile .cat-name {
    font-family: "Anton", sans-serif;
    font-size: 24px;
    text-transform: uppercase;
}

.category-tile .cat-code {
    font-family: "Space Mono", monospace;
    font-size: 12px;
    color: var(--ink-soft);
}

.category-tile:hover .cat-code {
    color: white;
    opacity: 0.8;
}

/* Same grid rules as #products, exposed as a class so the home page's
   Fresh Drops grid (#featured-grid) can share it without duplicate ids. */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 30px;
}

/* ==========================================
   LOADING & EMPTY STATES
========================================== */
.loading-state,
.empty-state {
    grid-column: 1 / -1;
    background:var(--surface);
    border: 2px dashed #999;
    border-radius: 25px;
    padding: 60px 20px;
    text-align: center;
    font-family: "Space Mono", monospace;
    color: #666;
    text-transform: uppercase;
}

/* ==========================================
   CART PAGE
========================================== */
.gate {
    margin-top: 40px;
    padding: 80px 24px;
    text-align: center;
    background: var(--surface);
    border: 2px dashed var(--ink-soft);
    border-radius: 25px;
}

.gate h2 {
    font-family: "Anton", sans-serif;
    font-size: 32px;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.gate p {
    color: var(--ink-soft);
    max-width: 480px;
    margin: 0 auto 28px;
}

/* ==========================================
   PROFILE PAGE
========================================== */

.profile-card {
    margin-top: 40px;
    padding: 60px 24px;
    text-align: center;
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: 25px;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

.profile-avatar-large {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    font-family: "Space Mono", monospace;
    font-size: 34px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
}

.profile-card h2 {
    font-family: "Anton", sans-serif;
    font-size: 26px;
    text-transform: none;
    letter-spacing: 0;
    word-break: break-word;
}

.profile-card p {
    color: var(--ink-soft);
    font-family: "Space Mono", monospace;
    font-size: 13px;
    margin-top: 10px;
}

.profile-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 30px;
    margin-top: 30px;
    align-items: start;
}

.cart-list {
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: 25px;
}

.cart-list .loading-state,
.cart-list .empty-state {
    border: none;
    margin: 0;
}

.cart-row {
    display: grid;
    grid-template-columns: 90px 1fr auto auto;
    gap: 18px;
    align-items: center;
    padding: 18px;
}

.cart-row + .cart-row {
    border-top: 2px solid var(--bg);
}

.cart-row img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border: 2px solid var(--ink);
    border-radius: 25px;
}

.cart-item-name {
    font-family: "Anton", sans-serif;
    font-size: 17px;
    text-transform: uppercase;
}

.cart-item-meta {
    font-family: "Space Mono", monospace;
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 4px;
}

.cart-item-price {
    font-family: "Space Mono", monospace;
    font-size: 14px;
    color: #2563eb;
    font-weight: bold;
    margin-top: 6px;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 2px solid var(--ink);
    font-family: "Space Mono", monospace;
}

.qty-control button {
    width: 30px;
    height: 30px;
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
}

.qty-control button:hover {
    background: #2563eb;
    color: white;
}

.qty-control span {
    min-width: 30px;
    text-align: center;
    font-size: 13px;
}

.remove-link {
    font-family: "Space Mono", monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #dc2626;
    border-bottom: 1px solid #dc2626;
    background: none;
    padding: 0;
}

.cart-summary {
    border: 2px solid var(--ink);
    border-radius: 25px;
    background: var(--surface);
    padding: 26px;
    position: sticky;
    top: 96px;
}

.cart-summary h2 {
    font-family: "Anton", sans-serif;
    font-size: 24px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-family: "Space Mono", monospace;
    font-size: 13px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg);
}

.summary-row.total {
    font-size: 17px;
    font-weight: bold;
    border-bottom: none;
    border-top: 2px solid var(--ink);
    margin-top: 6px;
    padding-top: 16px;
}

.summary-actions {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-block {
    width: 100%;
}

/* ==========================================
   FOOTER
========================================== */
footer {
    margin-top: 80px;
    background: #111;
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.footer-logo {
    height: 34px;
    width: auto;
    margin: 0 auto 10px;
    display: block;
}

footer p {
    color: #ccc;
    margin-top: 10px;
    font-family: "Space Mono", monospace;
    font-size: 13px;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 18px 0;
}

.social-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.social-icon:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* ==========================================
   LOGIN PAGE
========================================== */
.login-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 80px);
}

.login-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    background:var(--surface);
    border-radius: 25px;
}

.login-container h1 {
    font-family: "Anton", sans-serif;
    font-size: 60px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.login-container p {
    color:var(--ink-soft);
    margin-bottom: 30px;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-container form[hidden] {
    display: none;
}

.login-container input {
    padding: 15px;
    border: 2px solid var(--ink);
    border-radius: 20px;
    font-size: 16px;
    background: var(--surface);
    color: var(--ink);
}

.login-container input:focus {
    outline: none;
    border-color: #2563eb;
}

/* Login / Sign Up tab switcher, sits above whichever form is active */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid var(--ink);
    border-radius: 20px;
    margin-bottom: 28px;
}

.auth-tab {
    background: var(--surface);
    color: var(--ink);
    padding: 14px;
    font-family: "Space Mono", monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#tab-login {
    border-radius: 18px;
}

#tab-signup {
    border-radius: 18px;
}

.auth-tab[aria-selected="true"] {
    background: #2563eb;
    color: white;
}

#message {
    margin-top: 15px;
    color: #dc2626;
    font-weight: bold;
    min-height: 20px;
}

.auth-switch {
    margin-top: 24px;
    font-size: 13px;
    color: var(--ink-soft);
    text-align: center;
}

@media (max-width: 900px) {

    .login-page {
        grid-template-columns: 1fr;
    }

    .login-image {
        display: none;
    }

    .login-container {
        padding: 40px 25px;
    }

}

/* ==========================================
   TOAST
========================================== */

.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #111;
    color: white;
    font-family: "Space Mono", monospace;
    font-size: 13px;
    padding: 16px 26px;
    border: 2px solid var(--ink);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 2000;
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================
   SIMPLE ANIMATIONS
========================================== */

.product-card,
.cart-row,
.category-btn,
.add-cart-btn,
.btn {
    transition: all 0.3s ease;
}

.fade-in {
    animation: fadeIn .5s ease;
}

@keyframes fadeIn {

    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}

/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 992px) {

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        max-width: 450px;
        margin: auto;
    }

}

@media (max-width: 768px) {

    nav .nav-container {
        flex-direction: column;
        height: auto;
        padding: 20px;
        gap: 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .cart-row {
        grid-template-columns: 64px 1fr;
        row-gap: 10px;
    }

    .cart-row img {
        width: 64px;
        height: 64px;
    }

    .qty-control,
    .remove-link {
        grid-column: 2;
        justify-self: start;
    }

    #products {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .category-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-text h1 {
        font-size: 58px;
    }

}

@media (max-width: 480px) {

    .category-strip {
        grid-template-columns: 1fr;
    }

    main {
        width: 95%;
    }

    .hero {
        padding: 50px 20px;
    }

    .hero-text h1 {
        font-size: 46px;
    }

    .hero-text p {
        font-size: 16px;
    }

    .btn {
        width: 100%;
    }

    .product-card img {
        height: 260px;
    }

}