/*=========================================================
   YARNLINK CUSTOMER SITE: PHONE FIXES
   Loaded LAST (from includes/header.php), so it only
   adds to / overrides the other stylesheets on small screens.
   Desktop is not affected. To undo everything, remove the
   <link> to this file in includes/header.php.
=========================================================*/

/* Stop iPhone from enlarging text when the phone is turned sideways */
html{
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
}

/*---------------------------------------------------------
   HEADER: logo + bell + cart + account + menu must fit 360px
---------------------------------------------------------*/
@media (max-width:480px){
    .site-header{ padding:10px 12px; }

    .site-logo{ gap:8px; min-width:0; }
    .site-logo img{ width:38px; height:38px; border-width:2px; flex-shrink:0; }
    .site-logo h1{ font-size:18px; white-space:nowrap; }

    .header-actions{ gap:6px; }
    .icon-btn{ width:38px; height:38px; font-size:15px; flex-shrink:0; }
    .user-menu-trigger{ padding:6px 8px; gap:4px; }

    /* Notification list: use the width of the screen instead of a fixed 290px box */
    .notif-dropdown{
        position:fixed;
        top:68px;
        left:10px;
        right:10px;
        width:auto;
        max-height:70vh;
    }

    /* Pop-up message: full width at the bottom */
    .notif-toast{
        left:12px;
        right:12px;
        bottom:12px;
        max-width:none;
    }
}

/*---------------------------------------------------------
   CART: the "+" button was hidden behind the price.
   New layout per item (phones):
      [tick] [photo] name / price        [trash]
      [tick] [ - 1.0 + ]                  ₱660.00
---------------------------------------------------------*/
@media (max-width:700px){
    .cart-item{
        grid-template-areas:
            "check thumb info remove"
            "check qty   qty  total";
    }

    .cart-item .qty-control{
        justify-self:start;
    }

    .cart-item .qty-control .qty-input{
        width:52px;
    }

    .cart-item .cart-item-total{
        justify-self:end;
        font-size:15px;
        white-space:nowrap;
    }
}

/*---------------------------------------------------------
   MY PROFILE: stat cards were wider than the screen,
   tabs were hidden to the right
---------------------------------------------------------*/
@media (max-width:600px){
    .stat-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap:10px;
    }

    .stat-card{
        min-width:0;
        padding:12px;
        gap:10px;
    }

    .stat-value{
        font-size:15px;
        overflow-wrap:anywhere;
    }

    .stat-label{
        font-size:12px;
    }

    /* Tabs become pills that all stay on screen (same style as My Orders) */
    .account-tabs{
        flex-wrap:wrap;
        gap:8px;
        border-bottom:none;
        overflow:visible;
    }

    .tab-btn{
        margin-bottom:0;
        padding:8px 14px;
        font-size:13px;
        background:#fff;
        border:1.5px solid #E5DCCF;
        border-radius:999px;
    }

    .tab-btn.active{
        background:var(--accent);
        border-color:var(--accent);
        color:#fff;
    }

    .tab-btn.active .tab-count{
        background:rgba(255,255,255,.22);
        color:#fff;
    }
}

/* Very narrow phones: keep long amounts like ₱47,800.00 inside their card */
@media (max-width:400px){
    .stat-value{ font-size:14px; }
}

/*---------------------------------------------------------
   CHECKOUT + ORDER SUCCESS
---------------------------------------------------------*/
@media (max-width:700px){
    .checkout-page{ padding:24px 16px 36px; }
    .checkout-page h2{ font-size:24px; margin-bottom:18px; }
    .checkout-grid{ gap:20px; }
    .checkout-card{ padding:18px; }
    .payment-option{ padding:14px; }

    .order-success{ margin:40px auto; }
    .order-success-actions{
        flex-wrap:wrap;
    }
    .order-success-actions > *{
        flex:1 1 100%;
        text-align:center;
    }
}

/*---------------------------------------------------------
   FORM FIELDS: 16px stops iPhone Safari from zooming in
   when a customer taps a field
---------------------------------------------------------*/
@media (max-width:600px){
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
    select,
    textarea{
        font-size:16px;
    }
}

/*---------------------------------------------------------
   MY ORDERS (phones): photo at the top of the card, and the
   order tracker as a vertical list so every label is readable
---------------------------------------------------------*/
@media (max-width:480px){
    .order-top{
        align-items:flex-start;
    }

    .track-steps{
        flex-direction:column;
    }

    .track-step{
        flex:none;
        padding:0 0 16px 28px;
        font-size:13px;
        line-height:1.3;
    }

    .track-step:last-child{
        padding-bottom:0;
    }

    .track-step::before{
        top:1px;
        left:0;
    }

    /* connector now runs downward to the next dot */
    .track-step::after{
        top:16px;
        bottom:-1px;
        left:6px;
        right:auto;
        width:2px;
        height:auto;
    }
}
