/*=========================================================
                USER MENU (LOGGED-IN HEADER)
=========================================================*/
.user-menu{
    position:relative;
}

.user-menu-trigger{
    display:flex;
    align-items:center;
    gap:8px;

    padding:10px 16px;
    border:1.5px solid #E8E8E8;
    border-radius:10px;
    background:#FFFFFF;

    font-size:14px;
    font-weight:600;
    color:#333;
}

.user-menu-trigger:hover{
    border-color:#8B5E3C;
}

.user-menu-trigger i:first-child{
    font-size:18px;
    color:#8B5E3C;
}

.user-menu-trigger i:last-child{
    font-size:11px;
    color:#999;
}

.user-dropdown{
    display:none;
    position:absolute;
    top:calc(100% + 8px);
    right:0;

    min-width:190px;

    background:#FFFFFF;
    border-radius:12px;
    box-shadow:0 12px 30px rgba(0,0,0,.12);
    padding:8px;

    z-index:1001;
}

.user-dropdown.open{
    display:block;
}

.user-dropdown a{
    display:flex;
    align-items:center;
    gap:10px;

    padding:10px 12px;
    border-radius:8px;

    font-size:14px;
    color:#444;
}

.user-dropdown a:hover{
    background:#F3EAE0;
    color:#8B5E3C;
}

.user-dropdown a i{
    width:16px;
    color:#8B5E3C;
}


/*=========================================================
                SHOP PAGE
=========================================================*/
.shop-header{
    max-width:1400px;
    margin:0 auto;
    padding:50px 50px 0;
}

.shop-header h2{
    font-size:34px;
    font-weight:700;
    color:#8B5E3C;
    margin-bottom:8px;
}

.shop-header p{
    color:#777;
    font-size:15px;
}

.shop-filters{
    max-width:1400px;
    margin:0 auto;
    padding:30px 50px 0;

    display:flex;
    flex-wrap:wrap;
    gap:12px;
}

.filter-chip{
    padding:9px 18px;

    border:1.5px solid #E8E8E8;
    border-radius:999px;
    background:#FFFFFF;

    font-size:13px;
    font-weight:600;
    color:#555;

    transition:.3s;
}

.filter-chip:hover{
    border-color:#8B5E3C;
    color:#8B5E3C;
}

.filter-chip.active{
    background:#8B5E3C;
    border-color:#8B5E3C;
    color:#FFFFFF;
}

.shop-empty{
    max-width:1400px;
    margin:0 auto;
    padding:60px 50px;
    text-align:center;
    color:#999;
}

.product-stock{
    font-size:12px;
    color:#999;
    margin-top:4px;
}

.product-stock.low{
    color:#e74c3c;
}

.add-cart-btn:disabled{
    background:#CFC7BB;
    cursor:not-allowed;
}


/*=========================================================
                TOAST NOTIFICATION
=========================================================*/
.yl-toast{
    position:fixed;
    bottom:30px;
    right:30px;
    z-index:2000;

    background:#2B2621;
    color:#FFFFFF;

    padding:14px 22px;
    border-radius:12px;

    font-size:14px;
    font-weight:500;

    display:flex;
    align-items:center;
    gap:10px;

    box-shadow:0 12px 30px rgba(0,0,0,.2);

    opacity:0;
    transform:translateY(10px);
    transition:.3s ease;
    pointer-events:none;
}

.yl-toast.show{
    opacity:1;
    transform:translateY(0);
}

.yl-toast i{
    color:#8B5E3C;
}


/*=========================================================
                CART PAGE
=========================================================*/
.cart-page{
    max-width:1400px;
    margin:0 auto;
    padding:50px;

    display:grid;
    grid-template-columns:1fr 380px;
    gap:35px;
    align-items:start;
}

.cart-page h2{
    font-size:30px;
    font-weight:700;
    color:#8B5E3C;
    margin-bottom:24px;
    grid-column:1/-1;
}

.cart-items{
    display:flex;
    flex-direction:column;
    gap:16px;
}

.cart-item{
    background:#FFFFFF;
    border-radius:16px;
    padding:18px;

    display:flex;
    align-items:center;
    gap:18px;

    box-shadow:0 6px 16px rgba(0,0,0,.04);
}

.cart-item-thumb{
    width:64px;
    height:64px;
    flex-shrink:0;
    border-radius:12px;

    background:#F3EAE0;
    color:#8B5E3C;

    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
}

.cart-item-info{
    flex:1;
}

.cart-item-info h4{
    font-size:15px;
    font-weight:600;
    color:#333;
    margin-bottom:4px;
}

.cart-item-info span{
    font-size:13px;
    color:#8B5E3C;
    font-weight:600;
}

.qty-control{
    display:flex;
    align-items:center;
    gap:10px;

    border:1.5px solid #E8E8E8;
    border-radius:10px;
    padding:6px 10px;
}

.qty-control button{
    width:24px;
    height:24px;
    border:none;
    border-radius:6px;
    background:#F3EAE0;
    color:#8B5E3C;
    font-weight:700;
}

.qty-control span{
    min-width:36px;
    text-align:center;
    font-size:14px;
    font-weight:600;
}

.cart-item-remove{
    width:36px;
    height:36px;
    border:none;
    border-radius:50%;
    background:#FBEAEA;
    color:#e74c3c;
    display:flex;
    align-items:center;
    justify-content:center;
}

.cart-summary{
    background:#FFFFFF;
    border-radius:16px;
    padding:26px;

    box-shadow:0 6px 16px rgba(0,0,0,.04);
    position:sticky;
    top:100px;
}

.cart-summary h3{
    font-size:18px;
    font-weight:700;
    color:#333;
    margin-bottom:18px;
}

.summary-row{
    display:flex;
    justify-content:space-between;
    font-size:14px;
    color:#666;
    margin-bottom:12px;
}

.summary-row.total{
    font-size:17px;
    font-weight:700;
    color:#333;
    border-top:1px solid #EEE;
    padding-top:14px;
    margin-top:14px;
}

.cart-summary .btn-solid{
    width:100%;
    text-align:center;
    margin-top:16px;
    border:none;
}

.cart-empty{
    grid-column:1/-1;
    text-align:center;
    padding:60px 20px;
    color:#999;
}

.cart-empty a{
    color:#8B5E3C;
    font-weight:600;
}

@media (max-width:900px){
    .cart-page{
        grid-template-columns:1fr;
    }
}
/*=========================================================
        TYPOGRAPHY CONSISTENCY: Shop, Cart, About, Contact
=========================================================*/
:root{
    --t-page:30px;        /* page titles: Shop All Yarns, Your Cart */
    --t-hero-sub:38px;    /* hero headline on About and Contact */
}

/* Page titles (Shop + Cart) all the same size */
.shop-header h2,
.cart-page h2{
    font-size:var(--t-page);
    font-weight:700;
    line-height:1.25;
    margin-bottom:8px;
}
.cart-page h2{
    margin-bottom:22px;
}
.shop-header p{
    font-size:var(--t-body);
    color:var(--body-text);
}

/* Shop */
.shop-header{
    padding:44px 50px 0;
}
.shop-filters{
    padding:24px 50px 0;
}
.filter-chip{
    font-size:var(--t-small);
}
.product-stock{
    font-size:var(--t-small);
}

/* Cart */
.cart-page{
    padding:44px 50px;
}
.cart-item-info h4{
    font-size:var(--t-card);
}
.cart-summary h3{
    font-size:18px;
}
.summary-row{
    font-size:var(--t-body);
}
.summary-row.total{
    font-size:17px;
}

/* About + Contact: shorter hero, so a slightly smaller headline than Home.
   (:has() picks hero sections that have no stats row) */
.hero:not(:has(.hero-stats)) h2{
    font-size:var(--t-hero-sub);
}
.hero:not(:has(.hero-stats)) p{
    font-size:var(--t-body);
    max-width:560px;
    margin-bottom:0;
}

@media (max-width:700px){
    :root{
        --t-page:24px;
        --t-hero-sub:28px;
    }
    .shop-header,
    .shop-filters,
    .cart-page{
        padding-left:20px;
        padding-right:20px;
    }
}
/*=========================================================
        HERO + TITLE SIZE REFINEMENT (desktop + mobile)
=========================================================*/
:root{
    --t-hero:38px;        /* Home headline (was 44px) */
    --t-hero-sub:32px;    /* About + Contact headline (was 38px) */
    --t-page:26px;        /* Shop All Yarns / Your Cart (was 30px) */
}

/* ---------- Home hero ---------- */
.hero h2{
    line-height:1.2;
}
.hero p{
    font-size:15.5px;
    max-width:500px;
}
.hero-spool{
    width:300px;
    height:300px;
}

/* ---------- About + Contact hero (the ones without a stats row) ---------- */
.hero:not(:has(.hero-stats)){
    padding:44px 50px 48px;
    grid-template-columns:1.5fr .5fr;
}
.hero:not(:has(.hero-stats)) .hero-spool{
    width:120px;
    height:120px;
    border:none;
    box-shadow:0 10px 24px rgba(139,94,60,.25);
}
.hero:not(:has(.hero-stats)) .hero-spool i{
    font-size:42px;
}
.hero:not(:has(.hero-stats)) .hero-eyebrow{
    margin-bottom:16px;
}

/* ---------- Shop title ---------- */
.shop-header{
    padding:38px 50px 0;
}

/* ---------- Tablet ---------- */
@media (max-width:1100px){
    .hero{
        padding:44px 40px;
        gap:30px;
    }
    .hero-spool{
        width:220px;
        height:220px;
    }
    .hero:not(:has(.hero-stats)){
        padding:36px 40px 40px;
    }
    .hero:not(:has(.hero-stats)) .hero-visual{
        display:none;      /* the short About/Contact heroes don't need the icon here */
    }
}

/* ---------- Mobile ---------- */
@media (max-width:700px){
    :root{
        --t-hero:28px;
        --t-hero-sub:25px;
        --t-page:22px;
    }
    .hero{
        padding:32px 20px;
        gap:24px;
    }
    .hero p{
        font-size:14.5px;
        line-height:1.7;
    }
    .hero-spool{
        width:170px;
        height:170px;
    }
    .hero-badge{
        left:50%;
        transform:translateX(-50%);
        bottom:-18px;
        white-space:nowrap;
    }
    .hero-actions{
        flex-wrap:wrap;
        gap:12px;
    }
    .hero-stats div{
        padding:0 14px;
    }
    .hero-stats div h3{
        font-size:19px;
    }
    .hero:not(:has(.hero-stats)){
        padding:28px 20px 32px;
    }
    .shop-header{
        padding:28px 20px 0;
    }
}

/*=========================================================
                FOOTER LOGO (beside "YarnLink")
=========================================================*/
.footer-logo{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:14px;

    width:fit-content;
    color:inherit;
    text-decoration:none;
    cursor:pointer;
}

.footer-logo img{
    width:48px;
    height:48px;
    flex-shrink:0;
    border-radius:50%;
    object-fit:cover;
    background:#FFFFFF;
}

.footer-logo h2{
    margin:0;
}


/*=========================================================
        ORDER SUCCESS FOOTER SPACING
        (short page: keeps the footer from floating mid-screen)
=========================================================*/
.order-success{
    min-height:60vh;
}


/*=========================================================
        MOBILE NAVIGATION + HOME PAGE PHONE LAYOUT
=========================================================*/

/* Desktop: the menu button and the in-menu login buttons stay hidden */
.nav-toggle{
    display:none;
}
.nav-auth{
    display:none;
}

/* ---------- Tablet and smaller: single-column hero that can never be wider than the screen ---------- */
@media (max-width:1100px){
    .hero,
    .hero:not(:has(.hero-stats)){
        grid-template-columns:minmax(0,1fr);
    }
    .hero-text{
        min-width:0;
    }
}

/* ---------- Phones and small tablets: menu button replaces the nav links ---------- */
@media (max-width:900px){

    .site-header{
        padding:12px 24px;
    }

    .header-actions{
        gap:10px;
    }

    .icon-btn{
        width:42px;
        height:42px;
    }

    .nav-toggle{
        display:flex;
    }

    /* The nav becomes a panel that drops down under the header */
    .site-nav{
        display:none;
        position:absolute;
        top:100%;
        left:0;
        right:0;

        background:#FFFFFF;
        border-bottom:1px solid #E8E8E8;
        box-shadow:0 14px 24px rgba(0,0,0,.08);
        padding:8px 0 14px;
    }

    .site-nav.open{
        display:block;
    }

    .site-nav ul{
        flex-direction:column;
        align-items:stretch;
        gap:0;
    }

    .site-nav ul a{
        display:block;
        padding:14px 24px;
        font-size:16px;
    }

    .site-nav ul a.active{
        background:#F3EAE0;
        color:#8B5E3C;
    }

    .site-nav ul a.active::after{
        display:none;
    }
}

/* ---------- Phones ---------- */
@media (max-width:600px){

    .site-header{
        padding:10px 16px;
    }

    .site-logo{
        min-width:0;
        gap:10px;
    }

    .site-logo img{
        width:40px;
        height:40px;
        flex-shrink:0;
        border-width:2px;
    }

    .site-logo h1{
        font-size:19px;
    }

    .site-logo span{
        display:none;        /* "Marketplace System" is dropped on small screens */
    }

    /* Log In / Sign Up move into the menu so the header stays on one line */
    .header-actions > .btn-outline,
    .header-actions > .btn-solid{
        display:none;
    }

    .nav-auth{
        display:flex;
        gap:10px;
        padding:12px 20px 4px;
    }

    .nav-auth a{
        flex:1;
        text-align:center;
    }

    /* keep the button colours (the menu's own link colour would otherwise win) */
    .site-nav .nav-auth a.btn-solid{
        color:#FFFFFF;
    }

    .site-nav .nav-auth a.btn-outline{
        color:#8B5E3C;
    }

    .site-nav .nav-auth a.btn-outline:hover{
        color:#FFFFFF;
    }

    .user-name{
        display:none;
    }

    .user-menu-trigger{
        padding:9px 12px;
    }

    /* Notifications open as a card across the screen instead of hanging off the bell */
    .notif-dropdown{
        position:fixed;
        top:70px;
        left:12px;
        right:12px;
        width:auto;
        max-height:70vh;
    }

    .notif-toast{
        max-width:calc(100vw - 40px);
    }
}

/* ---------- Home page on phones ---------- */
@media (max-width:700px){

    .hero,
    .hero:not(:has(.hero-stats)){
        padding:28px 20px 40px;
        gap:22px;
    }

    /* Photo on top, COD card underneath (not floating over the yarn) */
    .hero-visual{
        flex-direction:column;
        gap:14px;
    }

    .hero-spool{
        width:210px;
        height:210px;
    }

    .hero-badge{
        position:static;
        transform:none;
        left:auto;
        bottom:auto;
        margin:0;
        white-space:normal;
        max-width:100%;
    }

    .hero-eyebrow{
        padding:8px 14px;
        border-radius:14px;
        font-size:12.5px;
        line-height:1.4;
        margin-bottom:16px;
    }

    .hero p{
        max-width:none;
        margin-bottom:22px;
    }

    .hero-actions{
        gap:10px;
        margin-bottom:26px;
    }

    .hero-actions a{
        flex:1 1 100%;
        display:inline-flex;
        align-items:center;
        justify-content:center;
        gap:8px;
        text-align:center;
    }

    .hero-stats{
        display:grid;
        grid-template-columns:repeat(3,minmax(0,1fr));
    }

    .hero-stats div{
        padding:0 10px;
    }

    .hero-stats div:first-child{
        padding-left:0;
    }

    .hero-stats div span{
        display:block;
        font-size:12px;
        line-height:1.35;
    }

    /* Page sections: the desktop side padding is too wide for a phone */
    .section{
        padding:36px 20px;
    }

    .section-header{
        gap:12px;
        margin-bottom:22px;
    }

    .section-link{
        white-space:nowrap;
        flex-shrink:0;
    }

    /* Categories: tighter cards */
    .category-card{
        padding:22px 18px;
    }

    .category-icon{
        width:56px;
        height:56px;
        font-size:22px;
        margin-bottom:12px;
    }

    /* Products: two per row, like most marketplace apps */
    .product-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:14px;
    }

    .product-thumb{
        height:120px;
    }

    .product-body{
        padding:12px;
    }

    .product-category{
        font-size:10.5px;
    }

    .product-body h4{
        font-size:14px;
        margin:6px 0 10px;
    }

    .product-price{
        font-size:15px;
    }

    .product-price span{
        display:block;
        font-size:11px;
    }

    .add-cart-btn{
        width:34px;
        height:34px;
        font-size:13px;
    }
}

@media (max-width:340px){
    .product-grid{
        grid-template-columns:minmax(0,1fr);
    }
}


/*=========================================================
                CART PAGE ON PHONES
=========================================================*/
.cart-item-total{
    width:80px;
    text-align:right;
    font-weight:600;
    color:#333;
}

@media (max-width:900px){
    /* minmax(0,1fr) stops a wide cart row from stretching the whole page */
    .cart-page{
        grid-template-columns:minmax(0,1fr);
    }

    .cart-items,
    .cart-summary{
        min-width:0;
    }

    .cart-summary{
        position:static;
    }
}

@media (max-width:700px){

    .cart-page{
        padding-top:28px;
        padding-bottom:36px;
        gap:22px;
    }

    /* Each item: tick box | photo | name + remove (top row), quantity + total (bottom row) */
    .cart-item{
        display:grid;
        grid-template-columns:auto 56px minmax(0,1fr) auto;
        grid-template-areas:
            "check thumb info remove"
            "check thumb qty total";
        gap:8px 12px;
        align-items:center;
        padding:14px;
    }

    .cart-item .item-check{
        grid-area:check;
    }

    .cart-item-thumb{
        grid-area:thumb;
        width:56px;
        height:56px;
    }

    .cart-item-info{
        grid-area:info;
        min-width:0;
    }

    .cart-item-info h4{
        font-size:14px;
        line-height:1.35;
    }

    .cart-item-remove{
        grid-area:remove;
        justify-self:end;
        width:34px;
        height:34px;
    }

    .qty-control{
        grid-area:qty;
        justify-self:start;
        gap:8px;
        padding:4px 8px;
    }

    /* bigger + and - buttons, easier to tap */
    .qty-control button{
        width:30px;
        height:30px;
    }

    .cart-item-total{
        grid-area:total;
        width:auto;
        white-space:nowrap;
    }

    .cart-summary{
        padding:20px;
    }

    .summary-row{
        gap:12px;
    }

    .summary-row span:last-child{
        text-align:right;
    }
}
