
/* =====================================
   COLLEGE FOOD - MAIN STYLESHEET
   Phanom Sarakham Technical College
===================================== */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800&display=swap');

:root {
    --red: #a80027;
    --red-dark: #780019;
    --red-light: #fce8ed;
    --green: #dff2d1;
    --green-dark: #66964d;
    --white: #ffffff;
    --text: #30262a;
    --gray: #858585;
    --background: #fffafa;
    --border: #f0e4e7;
    --shadow: 0 5px 18px rgba(100, 0, 25, .09);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Kanit', sans-serif;
    background: #f5f1f2;
    color: var(--text);
}

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

button {
    cursor: pointer;
    border: none;
}

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

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

/* MAIN APP */

.app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: auto;
    background: var(--background);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    padding-bottom: 85px;
}

/* HEADER */

.app-header {
    background: linear-gradient(135deg, #87001e, #b90032);
    color: white;
    padding: 20px 17px 24px;
    border-radius: 0 0 25px 25px;
    position: relative;
    overflow: hidden;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.college-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.college-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 3px;
}

.college-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.college-name small {
    display: block;
    font-size: 10px;
    font-weight: 300;
}

.header-icon {
    font-size: 22px;
    color: white;
    background: transparent;
}

.header-banner {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.header-banner h2 {
    font-size: 24px;
    line-height: 1.5;
}

.header-banner p {
    font-size: 12px;
}

.banner-image {
    width: 125px;
    height: 120px;
    object-fit: contain;
}

/* SEARCH */

.search-area {
    display: flex;
    gap: 8px;
    padding: 15px;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 13px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 30px;
    box-shadow: var(--shadow);
}

.search-box input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 13px;
}

.search-button {
    background: var(--red-light);
    color: var(--red);
    border-radius: 50%;
    width: 43px;
    height: 43px;
    font-size: 18px;
}

/* SECTION */

.section {
    padding: 8px 15px 16px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 13px;
}

.section-heading h3 {
    font-size: 17px;
    font-weight: 600;
}

.section-heading a {
    color: var(--red);
    font-size: 12px;
}

/* CATEGORY */

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

.category-item {
    background: white;
    padding: 13px 5px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: .25s;
    border: 1px solid var(--border);
}

.category-item:hover {
    transform: translateY(-4px);
    background: var(--red-light);
}

.category-icon {
    font-size: 27px;
    margin-bottom: 5px;
}

.category-item p {
    font-size: 11px;
}

/* SHOP GRID */

.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.shop-card {
    background: white;
    border-radius: 17px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: .25s;
}

.shop-card:hover {
    transform: translateY(-4px);
}

.shop-card img {
    width: 100%;
    height: 125px;
    object-fit: cover;
}

.shop-info {
    padding: 10px;
}

.shop-info h4 {
    font-size: 14px;
    margin-bottom: 3px;
}

.shop-info p {
    color: var(--gray);
    font-size: 11px;
}

.shop-status {
    color: var(--green-dark);
    font-size: 11px;
    margin-top: 5px;
}

/* FOOD MENU */

.food-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.food-card {
    display: flex;
    gap: 12px;
    background: white;
    padding: 9px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.food-card img {
    width: 105px;
    height: 90px;
    object-fit: cover;
    border-radius: 13px;
}

.food-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.food-info h4 {
    font-size: 13px;
}

.food-info p {
    font-size: 11px;
    color: var(--gray);
}

.food-price {
    color: var(--red);
    font-size: 18px;
    font-weight: 700;
}

.add-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: white;
    background: var(--red);
    font-size: 19px;
}

/* PROMOTION */

.promotion {
    margin: 10px 15px 18px;
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(120deg, #a9002c, #e74a67);
    color: white;
    position: relative;
    overflow: hidden;
}

.promotion h3 {
    font-size: 19px;
}

.promotion p {
    font-size: 12px;
}

.promotion button {
    background: white;
    color: var(--red);
    border-radius: 20px;
    padding: 7px 18px;
    margin-top: 10px;
}

/* FILTER */

.filter-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
}

.filter-list button {
    flex-shrink: 0;
    background: white;
    border: 1px solid var(--border);
    padding: 8px 17px;
    border-radius: 25px;
    font-size: 12px;
}

.filter-list button.active {
    background: var(--red);
    color: white;
}

/* BOTTOM NAVIGATION */

.bottom-nav {
    position: fixed;
    width: 100%;
    max-width: 480px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 70px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--border);
    z-index: 100;
    box-shadow: 0 -5px 20px rgba(0,0,0,.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #929292;
    font-size: 10px;
    background: transparent;
}

.nav-item span:first-child {
    font-size: 21px;
}

.nav-item.active {
    color: var(--red);
    font-weight: 600;
}

/* CART */

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 15px;
    margin-bottom: 10px;
}

.cart-item img {
    width: 75px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-control button {
    background: var(--red-light);
    color: var(--red);
    border-radius: 50%;
    width: 27px;
    height: 27px;
}

/* PRIMARY BUTTON */

.primary-button {
    width: 100%;
    background: linear-gradient(100deg, #a50029, #d20b43);
    color: white;
    padding: 13px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 5px 12px rgba(168,0,39,.2);
}

.primary-button:hover {
    background: var(--red-dark);
}

/* MODAL */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    background: white;
    padding: 22px;
    border-radius: 22px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 15px;
}

.form-input {
    width: 100%;
    padding: 12px;
    margin: 7px 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
}

/* QR CODE */

.qr-container {
    background: white;
    padding: 20px;
    border-radius: 18px;
    text-align: center;
}

.qr-container img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin: 15px auto;
}

/* ORDER STATUS */

.status-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 0;
}

.status-icon {
    width: 35px;
    height: 35px;
    background: var(--red-light);
    color: var(--red);
    border-radius: 50%;
    display: grid;
    place-items: center;
}

/* LOGIN */

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(140deg, #85001d, #c90038);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 30px 23px;
    border-radius: 25px;
    text-align: center;
}

/* ADMIN DASHBOARD */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.dashboard-card {
    padding: 17px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.dashboard-card strong {
    display: block;
    font-size: 23px;
    color: var(--red);
}

/* RESPONSIVE */

@media (min-width: 768px) {
    .app-container {
        max-width: 900px;
    }

    .shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .bottom-nav {
        max-width: 900px;
    }
}

@media (max-width: 360px) {
    .category-grid {
        gap: 5px;
    }

    .category-item p {
        font-size: 10px;
    }

    .shop-card img {
        height: 105px;
    }
}


/* CART ADD TOAST - small friendly feedback above the bottom navigation */
.cart-toast {
    position: fixed;
    left: 50%;
    bottom: 82px;
    transform: translate(-50%, 14px) scale(.96);
    width: min(440px, calc(100% - 28px));
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 13px;
    border: 1px solid #f4d5df;
    border-radius: 18px;
    background: rgba(255, 255, 255, .97);
    color: var(--text);
    box-shadow: 0 9px 28px rgba(100, 0, 25, .16);
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 150;
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.cart-toast.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
    animation: cartToastPop .32s cubic-bezier(.2,.85,.3,1.25);
}

.cart-toast-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: #76ad68;
    font-size: 14px;
    font-weight: 700;
}

.cart-toast strong {
    color: var(--red);
    font-weight: 600;
}

.cart-toast button {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 20px;
    background: var(--red-light);
    color: var(--red);
    font-size: 11px;
    font-weight: 600;
}

@keyframes cartToastPop {
    0% { transform: translate(-50%, 12px) scale(.92); }
    70% { transform: translate(-50%, -2px) scale(1.015); }
    100% { transform: translate(-50%, 0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .cart-toast,
    .cart-toast.show {
        animation: none;
        transition: opacity .15s ease;
    }
}
