/* =============================================
   RESTAURANT WEBSITE TEMPLATE - MAIN STYLESHEET
   D's Diner - v9 (clean rebuild, correct rule order)
   ============================================= */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e01020;
    --secondary-color: #a01010;
    --accent-color: #ef878f;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f9f9f9;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

/* =============================================
   LANGUAGE TOGGLE
   ============================================= */
.language-toggle {
    display: flex;
    gap: 5px;
}

.language-toggle button {
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.language-toggle button.active,
.language-toggle button:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* =============================================
   HEADER & NAVIGATION
   ============================================= */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 15px 0;
    position: relative;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.btn-order {
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-order:hover {
    filter: brightness(0.85);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Hamburger button - hidden on desktop */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    z-index: 1100;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* =============================================
   DROPDOWN (desktop Catering + Order Online)
   ============================================= */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle { cursor: pointer; }

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-radius: 6px;
    z-index: 1000;
    padding: 6px 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 18px;
    color: #333;
    text-decoration: none;
    font-size: 0.92rem;
    white-space: nowrap;
}

.dropdown-menu a + a { border-top: 1px solid #f0f0f0; }
.dropdown-menu a:hover { background: var(--primary-color); color: #fff; }

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu { display: block; }

.dropdown-toggle::after {
    content: " ▾";
    font-size: 0.75em;
}

/* Catering as plain red nav link (desktop) */
.catering-nav-link {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    padding: 8px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.catering-nav-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* =============================================
   MOBILE-ONLY ITEMS — hidden globally on desktop
   IMPORTANT: These rules MUST appear BEFORE the
   @media (max-width: 900px) block so the media
   query's display:block !important can override them.
   ============================================= */
.mobile-catering-item { display: none; }
.mobile-nav-actions { display: none; }
.desktop-only-item { display: inline-block; }

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

.hero-image img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.hero-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 40px 20px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.btn-primary {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 15px 40px;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    filter: brightness(0.85);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Hero two-button layout */
.hero-buttons {
    display: flex;
    flex-direction: row;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0;
}

.hero-buttons .btn-primary {
    flex: 1;
    min-width: 180px;
    max-width: 260px;
    text-align: center;
}

/* =============================================
   ORDER BENEFITS SECTION
   ============================================= */
.order-benefits {
    padding: 60px 0;
    background: var(--white);
}

.order-benefits h2 {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 40px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.benefit-item {
    text-align: center;
    padding: 30px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.benefit-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.benefit-item h3 { margin-bottom: 10px; color: var(--text-dark); }
.benefit-item p { color: var(--text-light); font-size: 0.95rem; }

/* =============================================
   ABOUT SECTION
   ============================================= */
.about {
    padding: 80px 0;
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-image img {
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    max-width: 400px;
    margin: 0 auto;
}

/* Two-location About */
.about-locations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.about-location-card {
    background: #f9f9f9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.about-location-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.about-location-info { padding: 1.2rem; }
.about-location-info h3 { color: var(--primary-color); margin-bottom: 0.5rem; }
.about-location-info p { margin: 0.3rem 0; font-size: 0.95rem; color: #555; }
.about-location-info a { color: var(--primary-color); }

/* =============================================
   FAVORITES SECTION
   ============================================= */
.favorites {
    padding: 80px 0;
    background: var(--bg-light);
}

.favorites h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 50px;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.favorite-item {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.favorite-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.favorite-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.favorite-item h3 { padding: 20px 20px 10px; color: var(--text-dark); font-size: 1.3rem; }
.favorite-item p { padding: 0 20px 20px; color: var(--text-light); }

/* =============================================
   TESTIMONIALS SECTION
   ============================================= */
.testimonials {
    padding: 80px 0;
    background: var(--white);
}

.testimonials h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 50px;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.testimonial-item {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.stars { color: var(--accent-color); font-size: 1.2rem; margin-bottom: 15px; }
.testimonial-item p { color: var(--text-light); margin-bottom: 15px; font-style: italic; }
.customer-name { font-weight: 600; color: var(--text-dark); font-style: normal !important; }

.rating-summary {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 20px;
}

/* =============================================
   GALLERY SECTION
   ============================================= */
.gallery {
    padding: 80px 0;
    background: var(--bg-light);
}

.gallery h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img { transform: scale(1.05); }

.gallery-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px 10px;
    text-align: center;
    transition: background 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    background: linear-gradient(to top, rgba(211, 47, 47, 0.9), rgba(211, 47, 47, 0.6));
}

.gallery-caption span {
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
    display: block;
    letter-spacing: 0.5px;
}

/* =============================================
   FAQ SECTION
   ============================================= */
.faq {
    padding: 80px 0;
    background: var(--white);
}

.faq h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 50px;
}

.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: background 0.3s ease;
}

.faq-question:hover { background: var(--bg-light); }
.faq-icon { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); transition: transform 0.3s ease; }
.faq-item.active .faq-icon { transform: rotate(45deg); }

.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.active .faq-answer { max-height: 500px; }
.faq-answer p { padding: 0 20px 20px; color: var(--text-light); line-height: 1.8; }

/* =============================================
   CONTACT SECTION
   ============================================= */
.contact {
    padding: 80px 0;
    background: var(--bg-light);
}

.contact h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 50px;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.contact-item { margin-bottom: 25px; }
.contact-item h3 { color: var(--primary-color); margin-bottom: 8px; font-size: 1.2rem; }
.contact-item a { color: var(--primary-color); font-weight: 500; }
.contact-item a:hover { text-decoration: underline; }
.contact-map iframe { border-radius: 10px; box-shadow: var(--shadow); width: 100%; }

/* Two-location Contact */
.contact-locations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.contact-location-block {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.contact-location-block h3 { color: var(--primary-color); margin-bottom: 1rem; font-size: 1.2rem; }
.contact-location-block .contact-item { margin-bottom: 1rem; }
.contact-location-block .contact-item h4 { font-size: 0.9rem; font-weight: 700; color: #333; margin-bottom: 0.2rem; }
.contact-location-block .contact-map { margin-top: 1rem; border-radius: 8px; overflow: hidden; }
.contact-location-block .contact-map iframe { width: 100%; height: 250px; border: 0; }

/* =============================================
   FOOTER
   ============================================= */
footer {
    background: #1a1a1a;
    color: #ccc;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 { color: var(--white); margin-bottom: 20px; font-size: 1.2rem; }
.footer-logo { height: 50px; width: auto; margin-bottom: 15px; }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #ccc; transition: color 0.3s ease; }
.footer-links a:hover { color: var(--primary-color); }

.social-links { display: flex; gap: 15px; }
.social-links a { color: #ccc; font-size: 1.3rem; transition: all 0.3s ease; }
.social-links a:hover { color: var(--primary-color); transform: translateY(-3px); }

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #333;
    color: #ccc;
}

.footer-bottom p { margin-bottom: 5px; font-size: 0.9rem; color: #ccc; }

.devournow-link { color: #ccc !important; font-weight: 600; }
.devournow-link:hover { color: #ffffff !important; text-decoration: underline; }

.privacy-link { color: #ccc !important; }
.privacy-link:hover { color: #ffffff !important; text-decoration: underline; }

/* =============================================
   BACK TO TOP BUTTON
   ============================================= */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: var(--shadow);
}

.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { filter: brightness(0.85); transform: translateY(-3px); }

/* =============================================
   LOYALTY POPUP
   ============================================= */
.popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    pointer-events: none;
}

.popup[style*="display: block"],
.popup[style*="display:block"] { pointer-events: auto; }

.popup-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    pointer-events: auto;
}

.popup-close {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.popup-close:hover { color: var(--text-dark); }
.popup-content h3 { color: var(--primary-color); font-size: 1.5rem; margin-bottom: 15px; }
.popup-content p { color: var(--text-light); margin-bottom: 25px; line-height: 1.6; }

/* =============================================
   MODAL CAPTION (gallery lightbox)
   ============================================= */
.modal-caption {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.85));
    color: white;
    padding: 15px 20px;
    text-align: center;
    width: 100%;
    max-width: 90vw;
    box-sizing: border-box;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.modal-caption h3 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.modal-caption p {
    margin: 0;
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 400;
    line-height: 1.4;
}

/* =============================================
   RESPONSIVE — 992px (layout reflow only)
   ============================================= */
@media (max-width: 992px) {
    .about-content { grid-template-columns: 1fr; }
    .about-image img { max-width: 100%; }
    .contact-content { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
}

/* =============================================
   RESPONSIVE — 900px MOBILE NAV
   This block MUST come AFTER the global
   .mobile-catering-item { display: none; } rule
   so that display:block !important wins.
   ============================================= */
@media (max-width: 900px) {

    /* Show hamburger button */
    .mobile-menu-toggle {
        display: flex !important;
    }

    /* Nav drawer: hidden by default, shown when .active */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
        gap: 15px;
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    /* Nav links in drawer: dark text, centered */
    .nav-menu .nav-link {
        color: var(--text-dark);
        text-align: center;
        width: 100%;
        display: block;
    }

    .nav-menu .nav-link:hover,
    .nav-menu .nav-link.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

    /* header-right: compact, hide desktop-only Catering link */
    .header-right {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .header-right .desktop-only-item {
        display: none !important;
    }

    .header-right .btn-order {
        padding: 7px 10px;
        font-size: 0.78rem;
    }

    .header-right .language-toggle button {
        padding: 5px 10px;
        font-size: 0.82rem;
    }

    .btn-order {
        padding: 7px 10px;
        font-size: 0.78rem;
    }

    /* -----------------------------------------------
       MOBILE CATERING EXPANDABLE ITEM IN DRAWER
       display:block !important overrides the global
       .mobile-catering-item { display: none; } above
       ----------------------------------------------- */
    .mobile-catering-item {
        display: block !important;
        width: 100%;
        list-style: none;
    }

    .mobile-catering-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        background: none;
        border: none;
        padding: 8px 0;
        font-size: 1rem;
        font-weight: 600;
        color: var(--primary-color);
        cursor: pointer;
        text-align: center;
        gap: 6px;
    }

    .mobile-catering-arrow {
        font-size: 0.7em;
        transition: transform 0.2s;
    }

    .mobile-catering-item.open .mobile-catering-arrow {
        transform: rotate(180deg);
    }

    .mobile-catering-sub {
        display: none;
        flex-direction: column;
        padding: 4px 0;
        list-style: none;
        margin: 0 auto;
        width: fit-content;
        border-left: 3px solid var(--primary-color);
        padding-left: 12px;
    }

    .mobile-catering-item.open .mobile-catering-sub {
        display: flex;
    }

    .mobile-catering-sub li a {
        display: block;
        padding: 8px 12px;
        color: var(--text-dark);
        text-decoration: none;
        font-size: 0.95rem;
        border-bottom: 1px solid #f0f0f0;
        text-align: center;
    }

    .mobile-catering-sub li:last-child a { border-bottom: none; }
    .mobile-catering-sub li a:hover { color: var(--primary-color); }

    /* Other mobile layout adjustments */
    .hero { min-height: 350px; }
    .hero h1 { font-size: 1.8rem; }
    .hero-subtitle { font-size: 1rem; }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }

    .gallery-item img { height: 150px; }

    .gallery-caption {
        padding: 10px 8px;
        background: linear-gradient(to top, rgba(211, 47, 47, 0.9), rgba(211, 47, 47, 0.6));
    }

    .gallery-caption span { font-size: 0.9rem; }

    .favorites-grid { grid-template-columns: 1fr; }
    .testimonials-grid { grid-template-columns: 1fr; }
    .benefits-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-content { grid-template-columns: 1fr 1fr; }
    .about-locations { grid-template-columns: 1fr; }
    .contact-locations { grid-template-columns: 1fr; }
}

/* =============================================
   RESPONSIVE — 480px small phones
   ============================================= */
@media (max-width: 480px) {
    .benefits-grid { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; }
    .language-toggle button { padding: 6px 12px; font-size: 0.8rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .hero-buttons .btn-primary { width: 100%; max-width: 320px; }
}
