/* ==========================================================
   Chatpata Club Smart Order
   File : components.css
   Description : Reusable UI Components
   ========================================================== */


/* ==========================================================
   ICON BUTTON
   ========================================================== */

.icon-button{

    width:46px;
    height:46px;

    display:flex;
    align-items:center;
    justify-content:center;

    background:var(--color-white);

    border:var(--border);

    border-radius:50%;

    box-shadow:var(--shadow-sm);

    transition:all var(--transition-fast);

    position:relative;

    cursor:pointer;
}

.cart-button{

    border-color:rgba(255, 107, 0, .24);

    box-shadow:
        0 8px 18px rgba(255, 107, 0, .12),
        var(--shadow-sm);

}

.icon-button:hover{

    background:var(--color-primary);

    color:#fff;

    transform:translateY(-2px);

    box-shadow:0 12px 26px rgba(255, 107, 0, .24);

}

.icon-button:active{

    transform:translateY(0) scale(.97);

}


/* ==========================================================
   CART BADGE
   ========================================================== */

#cartBadge{

    position:absolute;

    top:-5px;
    right:-5px;

    width:22px;
    height:22px;

    border-radius:50%;

    background:var(--color-danger);

    color:#fff;

    font-size:12px;

    display:flex;
    align-items:center;
    justify-content:center;

    font-weight:600;

    box-shadow:0 0 0 3px var(--color-white);
}


/* ==========================================================
   HERO BUTTON
   ========================================================== */

#heroOrderButton{

    background:#fff;

    color:var(--color-primary);

    padding:12px 28px;

    border-radius:50px;

    font-weight:600;

    transition:all .3s;

}

#heroOrderButton:hover{

    transform:translateY(-2px);

    box-shadow:var(--shadow-md);

}


/* ==========================================================
   SEARCH BOX
   ========================================================== */

#searchInput{

    background:#fff;

    border-radius:50px;

    padding-left:20px;

    font-size:15px;

    box-shadow:var(--shadow-sm);

}

.empty-products{

    grid-column:1 / -1;

    padding:28px 20px;

    border:var(--border);

    border-radius:var(--radius-lg);

    background:#fff;

    color:var(--color-text-light);

    text-align:center;

    box-shadow:var(--shadow-sm);

}


/* ==========================================================
   CATEGORY
   ========================================================== */

.sidebar li{

    display:flex;

    align-items:center;

    padding:12px 16px;

    border-radius:12px;

    cursor:pointer;

    transition:.25s;

}

.sidebar li:hover{

    background:var(--color-primary-light);

    color:var(--color-primary);

}

.sidebar li.active{

    background:var(--gradient-primary);

    color:#fff;

    font-weight:600;

}


/* ==========================================================
   PRODUCT CARD
   ========================================================== */

.hidden{

    display:none !important;

}

.product-card{

    background:#fff;

    border-radius:20px;

    overflow:hidden;

    border:var(--border);

    box-shadow:var(--shadow-sm);

    transition:all .30s;

    display:flex;

    flex-direction:column;

}

.product-card:hover{

    transform:translateY(-8px);

    box-shadow:var(--shadow-lg);

}


/* ==========================================================
   PRODUCT IMAGE 
   ========================================================== */

.product-image{

    position:relative;

    aspect-ratio:4/3;

    overflow:hidden;

}

.product-image img{

    width:100%;

    height:100%;

    object-fit:cover;

    transition:transform .45s;

}

.product-card:hover img{

    transform:scale(1.05);

}


/* ==========================================================
   BADGES
   ========================================================== */

.veg-badge{

    position:absolute;

    top:14px;

    left:14px;

    background:#fff;

    padding:6px 10px;

    border-radius:50px;

    font-size:12px;

    box-shadow:var(--shadow-sm);

}

.special-badge{

    position:absolute;

    top:14px;

    right:14px;

    background:gold;

    color:#000;

    padding:6px 10px;

    border-radius:50px;

    font-size:12px;

}


/* ==========================================================
   PRODUCT BODY
   ========================================================== */

.product-body{

    padding:18px;

    display:flex;

    flex-direction:column;

    gap:10px;

    flex:1;

}

.product-name{

    font-size:18px;

    font-weight:600;

}

.product-description{

    font-size:14px;

    color:var(--color-text-light);

    line-height:1.5;

    min-height:45px;

}


/* ==========================================================
   PRODUCT FOOTER
   ========================================================== */

.product-footer{

    margin-top:auto;

    display:flex;

    justify-content:space-between;

    align-items:center;

}

.product-price{

    font-size:20px;

    font-weight:700;

    color:var(--color-primary);

}


/* ==========================================================
   ADD BUTTON
   ========================================================== */

/* ==========================================================
   ADD BUTTON
========================================================== */

.btn-add-cart{

    width:90px;
    height:36px;

    display:flex;
    align-items:center;
    justify-content:center;

    border:2px solid var(--color-primary);
    border-radius:20px;

    background:#fff;
    color:var(--color-primary);

    font-size:14px;
    font-weight:700;

    text-transform:uppercase;
    letter-spacing:.5px;

    cursor:pointer;

    transition:all .25s;

}

.btn-add-cart:hover{

    background:var(--gradient-primary);

    color:#fff;

    transform:translateY(-2px);

}


/* ==========================================================
   QUANTITY
========================================================== */

.qty-controls{

    display:flex;

    align-items:center;

    gap:10px;

}

.qty-minus,
.qty-plus{

    width:34px;

    height:34px;

    border:none;

    border-radius:50%;

    background:var(--color-primary);

    color:#fff;

    font-size:20px;

    font-weight:bold;

    cursor:pointer;

    transition:.2s;

}

.qty-minus:hover,
.qty-plus:hover{

    transform:scale(1.08);

}

.qty-minus.disabled,
.qty-plus.disabled{

    background:#d5d5d5;

    cursor:not-allowed;

}

.qty-value{

    width:24px;

    text-align:center;

    font-weight:700;

    font-size:16px;

}


/* ==========================================================
   FLOATING CART
   ========================================================== */

.floating-cart button{

    background:#fff;

    color:var(--color-primary);

    border-radius:var(--radius-round);

    padding:11px 18px;

    font-weight:600;

    box-shadow:0 8px 18px rgba(0,0,0,.12);

    transition:transform .2s, box-shadow .2s;

    white-space:nowrap;

}

.variant-selector{

    display:flex;

    width:100%;

    min-height:38px;

    gap:4px;

    padding:4px;

    border:1px solid #d9dde3;

    border-radius:8px;

    background:#f6f7f9;

}

.variant-option{

    flex:1 1 0;

    min-width:0;

    min-height:30px;

    padding:5px 8px;

    border:1px solid transparent;

    border-radius:6px;

    background:transparent;

    color:var(--color-text);

    font-size:13px;

    font-weight:600;

    cursor:pointer;

    line-height:1.25;

    overflow-wrap:anywhere;

    display:flex;

    flex-direction:column;

    align-items:center;

    justify-content:center;

}

.variant-option small{

    display:block;

    margin-top:2px;

    font-size:9px;

    font-weight:600;

    line-height:1.1;

    text-decoration:none;

}

.variant-option.active{

    border-color:var(--color-primary);

    background:#fff;

    color:var(--color-primary);

    box-shadow:var(--shadow-sm);

}

.variant-option:disabled{

    color:#8b929c;

    text-decoration:line-through;

    cursor:not-allowed;

}

.variant-select{

    width:100%;

    min-height:38px;

    padding:6px 10px;

    border:0;

    border-radius:6px;

    background:#fff;

    color:var(--color-text);

    font:inherit;

}

.product-availability{

    margin:0;

    color:#a33a22;

    font-size:13px;

    font-weight:600;

}

.product-card.is-out-of-stock .product-image img{

    opacity:.72;

}

.floating-cart button:hover{

    transform:translateY(-1px);

    box-shadow:0 12px 24px rgba(0,0,0,.16);

}

.floating-cart button:active{

    transform:translateY(0) scale(.98);

}


/* ==========================================================
   CART ITEM
   ========================================================== */

.cart-item{

    display:flex;

    gap:14px;

    margin-bottom:20px;

}

.cart-image{

    width:72px;

    height:72px;

    border-radius:12px;

    object-fit:cover;

}

.cart-details{

    flex:1;

}

.cart-name{

    margin-bottom:8px;

}

.cart-actions{

    display:flex;

    align-items:center;

    gap:10px;

}

.cart-actions button{

    width:32px;

    height:32px;

    border-radius:50%;

    background:var(--gradient-primary);

    color:#fff;

}


/* ==========================================================
   CHECKOUT BUTTON
   ========================================================== */

#checkoutButton,
#payButton{

    width:100%;

    margin-top:20px;

    min-height:50px;

    border-radius:var(--radius-round);

    background:var(--gradient-primary);

    color:#fff;

    font-size:16px;

    font-weight:600;

    box-shadow:0 12px 24px rgba(255, 107, 0, .24);

    cursor:pointer;

    transition:transform .2s, box-shadow .2s;

}

#checkoutButton:hover,
#payButton:hover{

    transform:translateY(-1px);

    box-shadow:0 16px 30px rgba(255, 107, 0, .30);

}

#checkoutButton:active,
#payButton:active{

    transform:translateY(0) scale(.99);

}


/* ==========================================================
   MODAL
   ========================================================== */

.close-button{

    position:absolute;

    top:18px;

    right:18px;

    width:40px;

    height:40px;

    border-radius:50%;

    background:#f4f4f4;

}

.close-button:hover{

    background:var(--color-danger);

    color:#fff;

}


/* ==========================================================
   SUCCESS MODAL
   ========================================================== */

.success-box h2{

    margin-bottom:18px;

}

.success-box button{

    margin-top:24px;

    background:var(--gradient-primary);

    color:#fff;

    padding:12px 24px;

    border-radius:12px;

}


/* ==========================================================
   LOADING CARD
   ========================================================== */

.loading-card{

    height:360px;

    background:#fff;

    border-radius:20px;

    overflow:hidden;

    border:var(--border);

}

.loading-image{

    height:220px;

    background:#ececec;

}

.loading-line{

    height:16px;

    margin:18px;

    border-radius:8px;

    background:#ececec;

}

.loading-line.short{

    width:60%;

}


/* ==========================================================
   TOAST
   ========================================================== */

.toast{

    position:fixed;

    top:100px;

    right:24px;

    background:var(--gradient-primary);

    color:#fff;

    padding:14px 20px;

    border-radius:12px;

    box-shadow:var(--shadow-lg);

    z-index:var(--z-toast);

}

/* ==========================================================
   APPLICATION FEEDBACK
   ========================================================== */

#successModal{

    padding:16px;

}

.success-box{

    border-radius:8px;

    box-shadow:var(--shadow-lg);

}

.success-box p{

    margin-top:8px;

    color:var(--color-text-light);

}

.success-box #orderNumber{

    display:block;

    margin-top:6px;

    color:var(--color-text);

    overflow-wrap:anywhere;

}

.success-box button{

    border-radius:8px;

}

.toast-region{

    position:fixed;

    top:88px;

    right:16px;

    display:flex;

    flex-direction:column;

    gap:10px;

    width:min(360px, calc(100vw - 32px));

    pointer-events:none;

    z-index:var(--z-toast);

}

.toast-region .toast{

    position:static;

    padding:14px 20px;

    border-radius:8px;

    background:var(--color-text);

    color:#fff;

    box-shadow:var(--shadow-lg);

    opacity:0;

    transform:translateY(-8px);

    transition:opacity .2s ease, transform .2s ease;

}

.toast-region .toast.visible{

    opacity:1;

    transform:translateY(0);

}

.toast-region .toast.error{

    background:var(--color-danger);

}

.toast-region .toast.success{

    background:var(--color-success);

}

.app-loading{

    position:fixed;

    inset:0;

    display:none;

    align-items:center;

    justify-content:center;

    padding:20px;

    background:rgba(0, 0, 0, .32);

    z-index:var(--z-loader);

}

.app-loading.open{

    display:flex;

}

.app-loading-content{

    display:flex;

    align-items:center;

    gap:14px;

    width:min(320px, 100%);

    padding:18px 20px;

    border-radius:8px;

    background:#fff;

    box-shadow:var(--shadow-lg);

}

.app-loading-content p{

    margin:0;

    font-weight:600;

}

.app-spinner{

    flex:0 0 auto;

    width:24px;

    height:24px;

    border:3px solid var(--color-primary-light);

    border-top-color:var(--color-primary);

    border-radius:50%;

    animation:app-spin .7s linear infinite;

}

body.modal-open{

    overflow:hidden;

}

@keyframes app-spin{

    to{

        transform:rotate(360deg);

    }

}

@media (max-width:600px){

    .toast-region{

        top:auto;

        bottom:88px;

    }

}
