/* ============================================
   Tamarindo Loco - Mobile-First Optimized CSS
   ============================================ */

/* CSS Custom Properties */
:root {
    --color-primary: #C8102E;
    --color-secondary: #228B22;
    --color-accent: #FFD700;
    --color-white: #FFFFFF;
    --color-black: #1a1a1a;
    --color-gray: #666;
    --color-light-gray: #f8f9fa;
    --font-primary: 'Poppins', sans-serif;
    --font-script: 'Dancing Script', cursive;
    
    /* Mobile-first spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Touch-friendly sizes */
    --touch-target-min: 44px;
    --border-radius: 15px;
    --transition-speed: 0.3s;
}

/* ============================================
   Base Styles - Mobile First
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--color-black);
    background-color: var(--color-white);
    overflow-x: hidden;
}

/* ============================================
   Accessibility - Skip to Content Link
   ============================================ */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-md);
    text-decoration: none;
    font-weight: 600;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   Focus Indicators for Keyboard Navigation
   ============================================ */

*:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

/* Container - Mobile First */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ============================================
   Header - Sticky on Mobile
   ============================================ */

.header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #e91e63 100%);
    color: var(--color-white);
    padding: var(--spacing-sm) 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.logo {
    font-family: var(--font-script);
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 700;
    color: var(--color-accent);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform var(--transition-speed) ease;
}

.logo:hover,
.logo:focus {
    transform: scale(1.05);
}

.logo-img {
    height: clamp(50px, 12vw, 70px);
    width: auto;
    display: block;
    object-fit: contain;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Touch-optimized buttons */
.lang-toggle {
    background: var(--color-accent);
    color: var(--color-black);
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    -webkit-tap-highlight-color: transparent;
}

.lang-toggle:hover,
.lang-toggle:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.phone-btn {
    background: var(--color-secondary);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    -webkit-tap-highlight-color: transparent;
}

.phone-btn:hover,
.phone-btn:active {
    background: #1a7a1a;
    transform: translateY(-2px);
}

/* ============================================
   Main Content
   ============================================ */

.main {
    margin-top: 100px;
}

/* ============================================
   Hero Section - Mobile Optimized
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-accent) 100%);
    color: var(--color-white);
    padding: var(--spacing-xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none"><circle cx="20" cy="20" r="2" fill="white" opacity="0.1"/><circle cx="80" cy="30" r="1.5" fill="white" opacity="0.1"/><circle cx="40" cy="60" r="1" fill="white" opacity="0.1"/><circle cx="70" cy="80" r="2" fill="white" opacity="0.1"/></svg>') repeat;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-logo {
    width: clamp(120px, 30vw, 200px);
    height: auto;
    margin: 0 auto var(--spacing-lg) auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    animation: fadeIn 0.6s ease-in;
}

.hero h1 {
    font-size: clamp(1.75rem, 6vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.3rem);
    margin-bottom: var(--spacing-md);
    opacity: 0.95;
    line-height: 1.4;
}

.hero-location {
    font-size: clamp(0.95rem, 3.5vw, 1.1rem);
    opacity: 0.9;
    font-weight: 500;
}

/* ============================================
   Navigation Section
   ============================================ */

.nav-section {
    background: var(--color-light-gray);
    padding: var(--spacing-md) 0;
    border-bottom: 3px solid var(--color-accent);
    position: sticky;
    top: 80px;
    z-index: 999;
}

.nav-menu {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.nav-btn {
    background: var(--color-white);
    color: var(--color-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--color-primary);
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn:hover,
.nav-btn.active,
.nav-btn:active {
    background: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
}

/* ============================================
   Sections
   ============================================ */

.section {
    padding: var(--spacing-xl) 0;
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    text-align: center;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    color: var(--color-primary);
    margin-bottom: var(--spacing-xl);
    font-family: var(--font-script);
    font-weight: 600;
}

/* ============================================
   Menu Styles - Mobile Optimized
   ============================================ */

.menu-category {
    margin-bottom: var(--spacing-xl);
}

.category-title {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-white);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius);
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.menu-item {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.menu-item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.1), transparent);
    transition: left 0.6s;
}

.menu-item:active::before {
    left: 100%;
}

.menu-item:active {
    transform: scale(0.98);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--color-accent);
}

.item-name {
    font-size: clamp(1.1rem, 4vw, 1.25rem);
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.3;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-xs) var(--spacing-md);
    margin: 0;
}

.item-description {
    color: var(--color-gray);
    line-height: 1.5;
    font-size: clamp(0.9rem, 3vw, 0.95rem);
    padding: 0 var(--spacing-md) var(--spacing-md) var(--spacing-md);
    margin: 0;
}

/* ============================================
   Featured Items
   ============================================ */

.featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.featured-item {
    background: var(--color-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: transform var(--transition-speed) ease;
}

.featured-item:active {
    transform: translateY(-5px);
}

.featured-image {
    height: 180px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-content {
    padding: var(--spacing-md);
}

.featured-name {
    font-size: clamp(1.1rem, 4vw, 1.2rem);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

.featured-description {
    color: var(--color-gray);
    font-size: clamp(0.9rem, 3vw, 0.95rem);
    line-height: 1.5;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-white);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    margin: var(--spacing-lg) auto;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.cta-button:active {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* ============================================
   Photo Gallery
   ============================================ */

.photos-intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--spacing-xl);
    color: var(--color-gray);
    font-size: clamp(1rem, 3.2vw, 1.1rem);
    line-height: 1.7;
}

.photo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

.photo-item {
    background: var(--color-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.photo-item img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    display: block;
}

.photo-caption {
    padding: var(--spacing-md);
    text-align: center;
    font-weight: 600;
    color: var(--color-primary);
    font-size: clamp(1rem, 3vw, 1.1rem);
    background: var(--color-light-gray);
}

.photo-item:active {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: var(--color-accent);
}

/* ============================================
   About Section
   ============================================ */

.about-content {
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    font-size: clamp(1rem, 3.5vw, 1.1rem);
    line-height: 1.8;
    color: var(--color-gray);
}

.about-content p {
    margin-bottom: var(--spacing-md);
}

/* ============================================
   Contact Section
   ============================================ */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.contact-card {
    background: var(--color-white);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.contact-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.contact-title {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.contact-info {
    color: var(--color-gray);
    line-height: 1.6;
}

.contact-info a {
    color: var(--color-primary);
    text-decoration: none;
    min-height: var(--touch-target-min);
    display: inline-block;
    padding: var(--spacing-xs) 0;
}

.hours-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

.day-hours {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid #eee;
}

.day {
    font-weight: 600;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background: linear-gradient(135deg, var(--color-primary), #1a1a1a);
    color: var(--color-white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    text-align: left;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    width: clamp(80px, 15vw, 120px);
    height: auto;
    margin-bottom: var(--spacing-md);
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.footer-heading {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--color-accent);
    font-family: var(--font-heading);
}

.footer-section p {
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.footer-tagline {
    font-weight: 500;
    color: var(--color-accent);
    margin-top: var(--spacing-sm);
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-speed) ease, padding-left var(--transition-speed) ease;
    padding: var(--spacing-xs) 0;
    display: inline-block;
}

.footer-nav a:hover,
.footer-nav a:focus {
    color: var(--color-accent);
    padding-left: var(--spacing-xs);
}

.footer-contact p {
    margin-bottom: var(--spacing-xs);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.footer-contact a:hover,
.footer-contact a:focus {
    color: var(--color-accent);
}

.footer-social {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.social-links {
    margin: 0;
}

.social-links a {
    color: var(--color-accent);
    font-size: 1.5rem;
    margin: 0 var(--spacing-md);
    text-decoration: none;
    transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
    display: inline-block;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    line-height: var(--touch-target-min);
    -webkit-tap-highlight-color: transparent;
}

.social-links a:hover,
.social-links a:focus {
    color: var(--color-white);
    transform: scale(1.1);
}

.social-links a:active {
    transform: scale(0.95);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin-bottom: var(--spacing-xs);
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    color: rgba(255, 255, 255, 0.9);
}

.footer-credit {
    font-size: 0.8rem !important;
    opacity: 0.7;
    margin-top: var(--spacing-xs);
}

.footer p {
    margin-bottom: var(--spacing-sm);
}

/* ============================================
   Tablet Breakpoint (481px and up)
   ============================================ */

@media (min-width: 481px) {
    .container {
        padding: 0 var(--spacing-lg);
    }
    
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .featured-image {
        height: 200px;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

/* ============================================
   Desktop Breakpoint (769px and up)
   ============================================ */

@media (min-width: 769px) {
    .container {
        max-width: 1200px;
        padding: 0 var(--spacing-xl);
    }
    
    .header-content {
        flex-wrap: nowrap;
    }
    
    .logo {
        font-size: 2.2rem;
    }
    
    .logo-img {
        height: 70px;
    }
    
    .hero-logo {
        width: 200px;
    }
    
    .footer-logo {
        width: 120px;
    }
    
    .main {
        margin-top: 80px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .nav-section {
        top: 70px;
    }
    
    .nav-menu {
        gap: var(--spacing-lg);
    }
    
    .nav-btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 1rem;
    }
    
    .menu-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .contact-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
    
    .item-header {
        flex-direction: row;
        gap: var(--spacing-md);
    }
    
    .item-price {
        margin-left: var(--spacing-md);
    }
    
    /* Desktop hover effects */
    .menu-item:hover::before {
        left: 100%;
    }
    
    .menu-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        border-color: var(--color-accent);
    }
    
    .featured-item:hover {
        transform: translateY(-10px);
    }
    
    .photo-item:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 30px rgba(0,0,0,0.18);
        border-color: var(--color-accent);
    }
    
    .cta-button:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    }
    
    .social-links a:hover {
        color: var(--color-white);
        transform: scale(1.1);
    }

    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xl);
    }
}

/* ============================================
   Performance Optimizations
   ============================================ */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Optimize font loading */
@supports (font-display: swap) {
    @font-face {
        font-display: swap;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}
