:root {
    --tp-red: #cc1016; /* Deep red for buttons/accents */
    --tp-yellow: #ffcb05; /* Brand yellow */
    --tp-orange: #ffb100;
    --tp-dark: #222222; /* Dark card background */
    --tp-darker: #111111; /* Footer background */
    --tp-text-light: #dddddd;
    --tp-white: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Poppins', sans-serif; 
    background: #f4f4f4; 
    color: var(--tp-dark);
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 1. Header & Buttons */
.main-header { 
    background: var(--tp-white); 
    padding: 1px 0; 
    border-bottom: 2px solid #eaeaea; 
    position: sticky; top: 0; z-index: 1000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
}
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.desktop-nav a { text-decoration: none; color: var(--tp-dark); font-weight: 600; margin: 0 15px; transition: 0.2s; }
.desktop-nav a:hover { color: var(--tp-red); }

.header-actions { display: flex; gap: 10px; }
.action-btn { 
    display: flex; align-items: center; gap: 8px; 
    background: #f8f8f8; border: 1px solid #ddd; border-radius: 8px; 
    padding: 6px 12px; 
    font-weight: 600; font-family: 'Poppins'; cursor: pointer; transition: 0.2s;
    font-size: 0.9rem; 
}
.action-btn:hover { background: #eee; }
.cart-btn { background: var(--tp-yellow); border-color: var(--tp-yellow); color: var(--tp-darker); }
.cart-btn:hover { background: var(--tp-orange); }
.cart-badge { background: var(--tp-red); color: white; padding: 2px 6px; border-radius: 10px; font-size: 0.8rem; }

/* Hide mobile cart bar on desktop */
.mobile-bottom-cart { display: none; }

/* --- Mobile Menu Styles --- */
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--tp-dark); }
.desktop-only { display: inline-block; }

.mobile-menu-overlay {
    position: fixed; top: 0; left: -100%; width: 100%; height: 100vh;
    background: rgba(0,0,0,0.8); z-index: 2000; transition: left 0.3s ease;
}
.mobile-menu-overlay.active { left: 0; }

.mobile-menu-content {
    width: 250px; height: 100%; background: var(--tp-white);
    padding: 20px; display: flex; flex-direction: column; gap: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
}
.close-menu-btn { align-self: flex-end; background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.mobile-menu-content a { text-decoration: none; color: var(--tp-dark); font-size: 1.2rem; font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid #eee; }

/* 2. Hero Slider (Smooth Fade) */
.hero-slider { 
    position: relative; 
    height: 400px; 
    width: 100%;
    overflow: hidden; 
    background: #000; 
}

.slide { 
    position: absolute; top: 0; left: 0; 
    width: 100%; 
    height: 100%; 
    background-size: cover; 
    background-position: center; 
    display: flex; align-items: center; justify-content: center; text-align: center;
    opacity: 0; transition: opacity 0.8s ease-in-out; z-index: 1;
}
.slide.active { opacity: 1; z-index: 2; }
.slide-content h2 { font-family: 'Kanit', sans-serif; font-size: 4rem; color: white; text-transform: uppercase; text-shadow: 3px 3px 0px black; margin-bottom: 20px;}

.slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    background: rgba(0,0,0,0.5); color: white; border: none; padding: 15px 20px;
    font-size: 1.5rem; cursor: pointer; transition: 0.3s;
}
.slider-arrow:hover { background: var(--tp-red); }
.slider-arrow.prev { left: 10px; }
.slider-arrow.next { right: 10px; }

/* 3. Category Strip (Hover Underline) */
.category-strip { background: var(--tp-darker); position: sticky; top: 92px; z-index: 999; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }

.strip-flex { display: flex; overflow-x: auto; white-space: nowrap; padding: 15px 0; gap: 30px; justify-content: center; }
.cat-link { color: white; text-decoration: none; font-weight: 700; text-transform: uppercase; font-size: 1.1rem; position: relative; padding-bottom: 5px; }

.cat-link::after {
    content: ''; position: absolute; width: 0; height: 3px;
    bottom: 0; left: 0; background-color: var(--tp-yellow);
    transition: width 0.3s ease;
}
.cat-link:hover::after { width: 100%; }
.cat-link.active-link { color: var(--tp-yellow); }
.cat-link.active-link::after { width: 100%; }

/* 4. Product Cards */
.menu-category { margin: 50px 0; scroll-margin-top: 160px; }
.category-title { font-family: 'Kanit', sans-serif; font-size: 2.5rem; color: var(--tp-darker); margin-bottom: 20px; text-transform: uppercase; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.tito-card {
    background: var(--tp-dark);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.tito-card-img {
    background: #ffffff; 
    height: 250px;
    display: flex; align-items: center; justify-content: center;
    padding: 0; overflow: hidden; 
}
.tito-card-img img {
    width: 100%; height: 100%; 
    object-fit: cover; 
    transition: transform 0.3s ease;
}
.tito-card:hover .tito-card-img img { transform: scale(1.05); }

.tito-card-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.tito-title { color: var(--tp-yellow); font-family: 'Kanit', sans-serif; font-size: 1.4rem; margin-bottom: 8px; letter-spacing: 0.5px; }
.tito-desc { color: var(--tp-text-light); font-size: 0.9rem; line-height: 1.4; margin-bottom: 20px; flex-grow: 1; }

.tito-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.tito-price { color: var(--tp-yellow); font-family: 'Kanit', sans-serif; font-size: 1.8rem; font-weight: 800; }
.tito-add-btn {
    background: var(--tp-red); color: white;
    border: none; border-radius: 6px;
    padding: 10px 20px; font-weight: 800; font-family: 'Poppins';
    cursor: pointer; transition: 0.2s; text-transform: uppercase; font-size: 0.9rem;
}
.tito-add-btn:hover { background: #ff1a1f; }

/* 5. Footer */
.main-footer { background: var(--tp-darker); color: white; padding: 60px 0 20px 0; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: var(--tp-yellow); font-family: 'Kanit'; font-size: 1.5rem; margin-bottom: 20px; }
.footer-col a { display: block; color: var(--tp-text-light); text-decoration: none; margin-bottom: 10px; transition: 0.2s; }
.footer-col a:hover { color: var(--tp-yellow); padding-left: 5px; }
.footer-col p { color: var(--tp-text-light); line-height: 1.6; margin-bottom: 10px; }
.footer-phone { font-size: 1.3rem; font-weight: bold; color: var(--tp-yellow); }
.social-links { display: flex; gap: 15px; margin-top: 15px; }
.social-links a { background: #333; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: white; font-weight: bold; }
.social-links a:hover { background: var(--tp-red); padding-left: 0; }
.footer-bottom { text-align: center; border-top: 1px solid #333; padding-top: 20px; color: #777; font-size: 0.9rem; }

/* 6. Add To Cart Modal (Popup) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100dvh;
    background: rgba(0, 0, 0, 0.85); z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.tito-modal-box {
    background: var(--tp-white);
    width: 90%; max-width: 900px; max-height: 90vh;
    border: 4px solid var(--tp-darker); border-radius: 10px;
    display: flex; flex-direction: column; position: relative;
    overflow: hidden; box-shadow: 10px 10px 0px var(--tp-red);
}
.close-modal-btn {
    position: absolute; top: 10px; right: 15px; z-index: 10;
    background: var(--tp-yellow); border: 2px solid var(--tp-darker);
    border-radius: 50%; width: 35px; height: 35px; font-weight: bold;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-layout { 
    display: flex; flex-direction: row; flex: 1; overflow-y: auto; 
    padding: 30px; gap: 40px; background: var(--tp-white);
}
.modal-left { 
    width: 45%; background: var(--tp-white); 
    display: flex; align-items: flex-start; justify-content: center; padding: 0; 
}
.modal-left img { width: 100%; height: auto; object-fit: contain; border-radius: 12px; }
.modal-right { 
    width: 55%; padding: 0; display: flex; flex-direction: column; 
    justify-content: flex-start; gap: 20px; 
}
.modal-text-header { display: flex; flex-direction: column; gap: 5px; }
.modal-text-header .tito-title { margin: 0; line-height: 1.1; }
.modal-text-header .tito-desc { margin: 0; }

.qty-wrapper { display: flex; justify-content: space-between; align-items: center; background: #f4f4f4; padding: 10px 15px; border-radius: 8px; border: 1px solid #ddd; }
.qty-controls { display: flex; align-items: center; gap: 15px; }
.qty-btn { background: var(--tp-yellow); border: 2px solid var(--tp-dark); width: 30px; height: 30px; font-weight: bold; cursor: pointer; border-radius: 4px; }
.qty-controls span { font-weight: 800; font-size: 1.2rem; }

.addon-group { margin-bottom: 20px; border-bottom: 3px solid #e0e0e0; padding-bottom: 20px; }
.addon-group-title { font-family: 'Kanit'; color: var(--tp-red); font-size: 1.2rem; margin-bottom: 10px; display: flex; justify-content: space-between; }
.addon-req-badge { font-size: 0.8rem; background: var(--tp-darker); color: white; padding: 2px 6px; border-radius: 4px; font-family: 'Poppins'; }
.addon-options-row { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 10px; }

/* Addon UI Styling */
.tito-standard-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.95rem; }
.hidden-radio, .custom-input-hidden { display: none; }
.tito-box-label { cursor: pointer; margin: 0; }
.tito-box-label .box-content {
    border: 2px solid #ddd; border-radius: 8px; padding: 8px 15px; min-width: 45px; 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: all 0.2s ease; background: transparent; color: var(--tp-dark);
}
.box-name { font-weight: 800; font-size: 1rem; }
.hidden-radio:checked + .box-content {
    background: var(--tp-yellow); border-color: var(--tp-yellow); color: var(--tp-darker);
    box-shadow: 0 4px 10px rgba(255, 203, 5, 0.4); 
}

.custom-indicator {
    height: 22px; width: 22px; background-color: transparent;
    border: 2px solid #ccc; border-radius: 5px; display: inline-block;
    position: relative; flex-shrink: 0; transition: 0.2s ease;
}
input[type="radio"].custom-input-hidden + .custom-indicator { border-radius: 50%; }
.custom-input-hidden:checked + .custom-indicator { background-color: var(--tp-red); border-color: var(--tp-red); }
.custom-indicator:after { content: ""; position: absolute; display: none; }
.custom-input-hidden:checked + .custom-indicator:after { display: block; }
input[type="checkbox"].custom-input-hidden + .custom-indicator:after {
    left: 7px; top: 3px; width: 5px; height: 10px;
    border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
input[type="radio"].custom-input-hidden + .custom-indicator:after {
    left: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: white;
}
.opt-name-text { margin-left: 5px; }
.addon-price { font-weight: bold; color: var(--tp-dark); }

.modal-footer { padding: 15px; background: var(--tp-darker); border-top: 2px solid var(--tp-dark); }
.modal-submit-btn { width: 100%; font-size: 1.2rem; padding: 15px; box-shadow: none; display: flex; justify-content: center; gap: 10px; }

/* 7. Premium Light Theme Cart Sidebar */
.cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100dvh;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(3px); 
    z-index: 3999; opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.cart-overlay.active { opacity: 1; visibility: visible; }

.cart-sidebar {
    position: fixed; top: 0; right: -100%; 
    width: 100%; max-width: 420px; height: 100dvh;
    background: #ffffff; color: var(--tp-dark); z-index: 4000;
    transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    display: flex; flex-direction: column;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
}
.cart-sidebar.active { right: 0; }
.cart-header { display: flex; align-items: center; padding: 20px; border-bottom: 1px solid #f0f0f0; }
.cart-close-btn { background: none; border: none; cursor: pointer; padding: 5px; color: var(--tp-dark); transition: 0.2s; }
.cart-close-btn:hover { color: var(--tp-red); }
.cart-header h2 { flex: 1; text-align: center; color: var(--tp-yellow); margin: 0; font-family: 'Kanit'; font-size: 1.8rem; padding-right: 30px; }
.cart-items-container { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 15px; background: #fafafa; }

.cart-item {
    background: #ffffff; border-radius: 12px; padding: 12px;
    display: flex; gap: 15px; position: relative; border: 1px solid #f0f0f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03); transition: transform 0.2s ease;
}
.cart-item:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.06); }
.cart-item img { width: 85px; height: 85px; object-fit: contain; border-radius: 8px; background: #f8f8f8; padding: 5px; }
.cart-item-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cart-item-title { font-weight: 800; font-size: 1.1rem; margin: 0 0 4px 0; color: var(--tp-dark); }
.cart-item-addons { font-size: 0.8rem; color: #777; margin: 0 0 6px 0; line-height: 1.3; }
.cart-item-price { font-weight: bold; color: var(--tp-red); font-size: 1.05rem; margin-top: auto; }
.cart-item-controls { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.cart-trash-btn { color: #bbb; background: none; border: none; cursor: pointer; padding: 5px; border-radius: 4px; transition: 0.2s; }
.cart-trash-btn:hover { color: #ff3b3b; background: #ffe6e6; }
.cart-qty-box { display: flex; align-items: center; gap: 12px; background: #f5f5f5; border-radius: 20px; padding: 3px; }
.cart-qty-btn {
    background: #fff; color: var(--tp-dark); border: none; border-radius: 50%;
    width: 26px; height: 26px; font-weight: bold; cursor: pointer; display: flex;
    justify-content: center; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: 0.2s;
}
.cart-qty-btn:hover { background: var(--tp-yellow); color: #000; }
.cart-qty-text { font-weight: 800; font-size: 0.95rem; min-width: 12px; text-align: center; }

.cart-footer { padding: 20px; border-top: 1px solid #f0f0f0; background: #fff; display: flex; flex-direction: column; gap: 12px; }
.cart-subtotal { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 800; color: var(--tp-dark); margin-bottom: 5px; }
.cart-yellow-text { color: var(--tp-red); }

/* Buttons */
.w-full { width: 100%; }
.btn-view-cart {
    background: #ffffff; color: var(--tp-dark); font-weight: 800; padding: 14px;
    border-radius: 8px; cursor: pointer; text-align: center; border: 2px solid #e0e0e0; 
    font-size: 1.1rem; transition: all 0.3s ease; 
}
.btn-view-cart:hover { 
    background: #f8f8f8; border-color: var(--tp-dark); color: var(--tp-red); 
    transform: scale(1.02); box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.btn-checkout {
    background: var(--tp-yellow); color: #000000; font-weight: 800; padding: 14px;
    border-radius: 8px; cursor: pointer; text-align: center; border: none; 
    font-size: 1.1rem; transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(252, 177, 22, 0.3);
}
.btn-checkout:hover { 
    background: var(--tp-dark); color: var(--tp-yellow); transform: scale(1.02); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.2); 
}

/* 8. Success Message Modal Base (Kept from Auth to support checkout message) */
.auth-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100dvh;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px);
    z-index: 5000; display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.auth-overlay.active { opacity: 1; visibility: visible; }
.auth-modal {
    background: #ffffff; width: 90%; max-width: 400px;
    border-radius: 16px; padding: 35px 25px; position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: translateY(20px); transition: 0.3s ease; text-align: center;
}
.auth-overlay.active .auth-modal { transform: translateY(0); }
.auth-title { font-family: 'Kanit'; font-size: 1.8rem; color: var(--tp-dark); margin: 0 0 8px 0; }
.auth-subtitle { color: #777; font-size: 0.95rem; margin: 0 0 25px 0; line-height: 1.4; }

/* 9. Guest Checkout Page Layout */
.checkout-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
    max-width: 100%;
}
.checkout-summary {
    order: 1; /* Forces to top on mobile */
    width: 100%; background: #fff; padding: 20px;
    border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.checkout-form-section {
    order: 2; /* Forces to bottom on mobile */
    width: 100%; background: #fff; padding: 20px; border-radius: 12px;
}
.chk-item-img {
    width: 60px; height: 60px; object-fit: cover;
    border-radius: 8px; border: 1px solid #eee; margin-right: 15px;
}
.chk-trash-btn {
    background: none; border: none; color: var(--tp-red);
    cursor: pointer; padding: 6px; border-radius: 6px;
    transition: 0.2s ease; display: inline-flex; align-items: center;
    justify-content: center; margin-top: 5px;
}
.chk-trash-btn:hover { background: #ffe6e6; }
.address-form-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 25px; }
.tito-input {
    width: 100%; border: 2px solid #e0e0e0; background: #fafafa;
    border-radius: 8px; padding: 12px 15px; font-size: 16px; /* 16px prevents iOS zoom */
    color: var(--tp-dark); font-family: inherit; transition: 0.2s; outline: none; resize: none; -webkit-appearance: none;
}
.tito-input:focus { border-color: var(--tp-yellow); background: #fff; box-shadow: 0 0 0 3px rgba(252, 177, 22, 0.15); }

/* --- Desktop Checkout Enhancement --- */
@media (min-width: 851px) {
    .checkout-layout {
        display: grid;
        grid-template-columns: 1.2fr 1fr; 
        flex-direction: row; 
        gap: 30px;
        padding: 40px 20px;
        max-width: 1100px;
        margin: 0 auto;
    }
    .checkout-summary {
        order: 2; 
        position: sticky;
        top: 20px; 
        height: fit-content;
    }
    .checkout-form-section { order: 1; }
}

/* --- Mobile Responsive Adjustments (Phones) --- */
@media (max-width: 768px) {
    .main-header { padding: 0; height: 70px; }
    .header-flex { position: relative; height: 100%; display: flex; align-items: center; }
    .mobile-menu-btn { display: block; position: absolute; left: 20px; }
    .desktop-nav, .header-actions { display: none !important; }
    .logo { 
        position: absolute; left: 50%; transform: translateX(-50%); 
        height: 50px; display: flex; align-items: center;
    }
    .logo img { max-height: 100%; width: auto; }

    /* Sticky Bottom Cart Bar */
    .mobile-bottom-cart {
        display: flex; justify-content: space-between; align-items: center;
        position: fixed; bottom: 0; left: 0; width: 100%;
        background: var(--tp-yellow); color: #000; padding: 16px 20px;
        z-index: 3900; box-shadow: 0 -4px 15px rgba(0,0,0,0.15);
        cursor: pointer; font-family: 'Kanit', sans-serif; font-weight: 800;
        transition: transform 0.3s ease;
    }
    .mobile-bottom-cart.show { transform: translateY(0); }
    .cart-bar-left { font-size: 1.1rem; }
    .cart-bar-right { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
    .arrow-circle { background: #000; color: var(--tp-yellow); border-radius: 50%; width: 24px; height: 24px; display: flex; justify-content: center; align-items: center; font-size: 0.9rem; }

    .hero-slider { height: 160px; aspect-ratio: auto; }
    .slide { background-size: cover; }
    .slide-content, .slider-arrow { display: none; }
    .btn-primary { padding: 8px 20px; font-size: 1rem; }

    .strip-flex { gap: 15px; padding: 10px 0; }
    .cat-link { font-size: 0.9rem; }
    .category-strip { top: 70px; } 

    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .tito-card-img { height: 130px; } 
    .tito-card-body { padding: 10px; }
    .tito-title { font-size: 1rem; margin-bottom: 5px; }
    .tito-desc { font-size: 0.75rem; line-height: 1.2; margin-bottom: 10px; }
    .tito-price { font-size: 1.2rem; }
    .tito-card-footer { flex-direction: column; align-items: stretch; gap: 8px; }
    .tito-add-btn { padding: 8px; font-size: 0.8rem; text-align: center; }

    .tito-modal-box { 
        max-height: 82dvh; width: 92%; margin: auto; 
    }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .social-links { justify-content: center; }

    .modal-layout { flex-direction: column; padding: 20px; gap: 15px; }
    .modal-left { width: 100%; height: auto; max-height: 200px; }
    .close-modal-btn { background: var(--tp-white); box-shadow: 0 2px 5px rgba(0,0,0,0.3); top: 10px; right: 10px; }
    .modal-left img { max-height: 200px; }
    .modal-right { width: 100%; padding: 0; }
}