/* 1. Design Tokens (Variables)
   ------------------------------------- */
:root {
    /* Color Palette */
    --brand-blue: #0096FF;           /* Vibrant, modern light blue for accents */
    --brand-blue-rgb: 0, 150, 255;
    --brand-blue-dark: #007acc;      /* A darker shade for hover states */
    --canvas-bg: #F8F9FA;
    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --border-color: #E2E8F0;
    --card-bg: #FFFFFF;
    --font-size-base: 1rem;

    /* Typography */
    --font-family-sans-serif: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Effects */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --transition-smooth: all 0.3s ease-in-out;
}

/* 2. Global Styles & Resets
   ------------------------------------- */
body {
    background-color: var(--canvas-bg);
    font-family: var(--font-family-sans-serif);
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

html {
    font-size: clamp(14px, 1.2vw, 16px);
}

.main-content-area {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

textarea {
    resize: none;
}

/* 3. Bootstrap Component Overrides
   ------------------------------------- */

/* Buttons */
.btn {
    transition: var(--transition-smooth);
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-width: 2px;
}

.btn-primary {
    background-color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--brand-blue-dark);
    border-color: var(--brand-blue-dark);
    box-shadow: 0 0 20px rgba(var(--brand-blue-rgb), 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    color: var(--brand-blue-dark);
    background-color: transparent;
    border-color: var(--brand-blue-dark);
}

.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active {
    color: var(--card-bg);
    background-color: var(--brand-blue-dark);
    border-color: var(--brand-blue-dark);
    transform: translateY(-2px);
}

/* Badges (e.g., cart count) */
.badge.bg-primary {
    background-color: var(--brand-blue) !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium) !important;
}

/* 4. Custom Component Styling
   ------------------------------------- */

.navbar.bg-white { 
    background-color: var(--canvas-bg) !important; 
    box-shadow: var(--shadow-medium); 
}

.navbar-brand-text { 
    font-weight: 700; color: 
    var(--text-primary); 
}

.navbar .nav-link { 
    font-weight: 500; color: var(--text-secondary); 
    transition: var(--transition-smooth); 
}

.navbar .nav-link:hover, .navbar .nav-link.active { 
    color: var(--brand-blue); 
}

.navbar-brand img { 
    height: 40px; width: auto; 
}

.hero-section { 
    position: relative; background-color: var(--card-bg); 
    color: var(--text-primary); background-size: cover; 
    background-position: center center; 
}

.hero-section::before { 
    content: ''; position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%; 
    background: linear-gradient(to top, rgba(255,255,255,0.3), transparent); z-index: 1; 
}

.hero-content { 
    position: relative; 
    z-index: 2; padding: 6rem 0; 
}

.hero-content h1 { 
    font-weight: 700 !important; 
}

/* 5. Upgraded Page Sections
   ------------------------------------- */

.features-section { padding: 4rem 0; }
.feature-card { background-color: var(--card-bg); padding: 2.5rem 2rem; text-align: center; border-radius: 1rem; height: 100%; }
.feature-icon-wrapper { margin: 0 auto 1.5rem auto; height: 80px; width: 80px; background-color: var(--brand-blue); color: var(--card-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: var(--transition-smooth); }
.feature-card:hover .feature-icon-wrapper { transform: scale(1.1) rotate(10deg); box-shadow: 0 10px 20px rgba(var(--brand-blue-rgb), 0.3); }
.feature-icon-wrapper i { font-size: 2.5rem; }
.feature-card h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-primary); }
.feature-card p { color: var(--text-secondary); line-height: 1.6; }

/* In main.css, find and replace the existing .menu-item-img rule */

.menu-item-img {
    width: 90px;
    height: 90px;
    
    /* ### THIS IS THE KEY CHANGE ### */
    /* Instead of 50%, we use a specific value for a "squircle" effect. */
    border-radius: 1.25rem; /* 20px */
    
    object-fit: cover;
    border: none; /* A border is not needed for this cleaner look */
    box-shadow: var(--shadow-medium); /* Use a slightly stronger shadow for depth */
    transition: transform 0.2s ease-in-out;
}

/* (All other CSS rules, including the hover effect, remain the same) */

/* --- ### END OF FIX ### --- */

/* ### NEW RULES FOR MENU PAGE ### */
.menu-item-card { overflow: hidden; }
.menu-item-img {
    aspect-ratio: 1 / 1; /* Enforces a perfect square shape */
    object-fit: cover;   /* Ensures the image fills the square without distortion */
    width: 100%;
}
.menu-item-card.is-out-of-stock {
    opacity: 0.5;
    background-color: var(--canvas-bg);
}
.out-of-stock-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

/* General Styles */
.section-heading { color: var(--text-primary); font-weight: 700; }
.heading-hr { width: 100px; height: 3px; background-color: var(--brand-blue); margin: 1rem auto; opacity: 1; }
.restaurant-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 1rem; border: 3px solid var(--border-color); box-shadow: var(--shadow-soft); }
.testimonial-section { padding: 4rem 0; background-color: var(--card-bg); }
.testimonial-card { background: transparent; border: none; box-shadow: none; max-width: 700px; margin: auto; text-align: center; }
.testimonial-img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem auto; border: 4px solid var(--canvas-bg); }
.testimonial-quote { font-style: italic; font-size: 1.1rem; color: var(--text-secondary); line-height: 1.6; }
.testimonial-name { font-weight: 600; margin-top: 1.5rem; color: var(--text-primary); }
.carousel-indicators [data-bs-target] { width: 10px; height: 10px; border-radius: 50%; background-color: var(--border-color); border: 0; transition: var(--transition-smooth); }
.carousel-indicators .active { background-color: var(--brand-blue); transform: scale(1.2); }
.restaurant-card-img { height: 200px; object-fit: cover; }
.restaurant-header-img { width: 100px; height: 100px; border-radius: 1rem; object-fit: cover; box-shadow: var(--shadow-medium); }
.menu-item-card { overflow: hidden; }
.menu-item-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease-in-out; }
.menu-item-card:hover .menu-item-img { transform: scale(1.05); }
.menu-item-card.is-out-of-stock { opacity: 0.6; background-color: #f1f1f1; }
.out-of-stock-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; }

/* Footer */
.main-footer { 
    background-color: #1A202C; 
    color: #A0AEC0; 
    padding-top: 4rem; 
}

.main-footer .footer-heading { 
    color: var(--card-bg); 
    margin-bottom: 20px; 
    font-weight: 600; 
    position: relative; 
    letter-spacing: 0.5px; 
}

.main-footer .footer-heading::after { 
    content: ""; 
    position: absolute; 
    left: 0; bottom: -8px; 
    height: 2px; 
    width: 40px; 
    background: var(--brand-blue); 
}

.main-footer .footer-link { 
    color: #A0AEC0; 
    text-decoration: none; 
    transition: var(--transition-smooth); 
}

.main-footer .footer-link:hover { 
    color: var(--brand-blue);
}
.main-footer .social-links a { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    width: 40px; 
    height: 40px; 
    border: 1px solid #4A5568; 
    border-radius: 50%; 
    margin-right: 10px; 
    color: #A0AEC0; 
    transition: var(--transition-smooth); 
}

.main-footer .social-links a:hover { 
    background-color: var(--brand-blue); 
    border-color: var(--brand-blue); 
    color: var(--card-bg); 
    transform: translateY(-2px); 
}

.main-footer .footer-bottom { 
    background-color: #11151C; 
    padding: 1.5rem 0; 
    margin-top: 3rem; 
    font-size: 0.9em; 
}

/*section 6 */

.restaurant-card-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover; 
    margin: 0 auto 1rem auto;
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.deal-card {
    position: relative;
}
.deal-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--brand-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 0.375rem;
    z-index: 10;
}
.deal-card-img {
    aspect-ratio: 1 / 1; /* Enforces a perfect square shape for uniform images */
    object-fit: cover;
    width: 100%;
}

/*Google Button Style*/
.btn-google {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
    font-weight: 500;
}
.btn-google:hover {
    background-color: #f7f7f7;
    border-color: #dcdcdc;
    color: var(--text-primary);
}
.btn-google svg {
    height: 20px;
    width: 20px;
    margin-right: 0.75rem;
    vertical-align: middle;
}
/* ### END: Google Button Style ### */

/* --- 10. Star Rating Styles --- */
.rating-stars { display: inline-block; }
.rating-stars input[type="radio"] { display: none; }
.rating-stars label {
    font-size: 2.5rem; color: #ccc;
    cursor: pointer; transition: color 0.2s;
}
.rating-stars label:hover,
.rating-stars label:hover ~ label,
.rating-stars input[type="radio"]:checked ~ label {
    color: #ffc700;
}

/* --- 11. Live Search Results Styles --- */
.live-search-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-medium);
    margin-top: 0.5rem;
    overflow: hidden;
    display: none; /* Hidden by default */
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease-in-out;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--canvas-bg);
}

.search-result-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-right: 1rem;
}

.search-result-details {
    line-height: 1.3;
}

.search-result-name {
    font-weight: 600;
    margin-bottom: 0;
}

.search-result-restaurant {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* --- 12. Order History & Tracking Styles --- */
.order-card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--canvas-bg);
}

.order-card-body {
    padding: 1.5rem;
}

.timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.timeline-item {
    text-align: center;
    color: #a0aec0; /* Muted grey for inactive steps */
    transition: color 0.3s ease-in-out;
}

.timeline-item.active {
    color: var(--brand-blue); /* Brand blue for active step */
    font-weight: 600;
}

.timeline-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e2e8f0; /* Light grey background */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 0.5rem auto;
    transition: background-color 0.3s ease-in-out;
}

.timeline-item.active .timeline-icon {
    background-color: var(--brand-blue);
    color: white;
}

.timeline-line {
    flex-grow: 1;
    height: 4px;
    background-color: #e2e8f0;
    margin-top: 23px; /* Align with center of icons */
}

.navbar.sticky-top {
    z-index: 1030; 
}

/* --- 14. Banner Ad Styles --- */
.banner-ad-section {
    padding: 2rem 0;
    background-color: var(--canvas-bg); /* A light background to separate it */
}

.banner-ad-section a {
    display: block;

/* --- 17. PWA Install Prompt Styles --- */
.pwa-install-popup .swal2-title {
    color: var(--brand-blue-dark);
    font-weight: 700;
}

.pwa-install-popup .swal2-html-container {
    color: var(--text-secondary);
}

.pwa-install-popup .swal2-confirm {
    background-color: var(--brand-blue) !important;
}

.pwa-install-popup .swal2-cancel {
    color: var(--text-secondary) !important;
}
