/*
Theme Name: YaEstá Theme
Theme URI: https://yaesta.pe
Author: YaEstá
Author URI: https://yaesta.pe
Description: Tema personalizado para la plataforma de delivery YaEstá. Diseñado para funcionar con el plugin YaEstá Delivery Platform.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yaesta-theme
Tags: delivery, food, restaurant, custom-header, custom-menu
*/

/* ============ RESET & BASE ============ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

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

:root {
    --ye-primary: #FF4136;
    --ye-primary-dark: #E0301E;
    --ye-primary-light: #FF6B63;
    --ye-secondary: #16213E;
    --ye-accent: #FF8C00;
    --ye-bg: #F5F6FA;
    --ye-white: #FFFFFF;
    --ye-text: #1F2937;
    --ye-text-light: #6B7280;
    --ye-gray-100: #F7F8FA;
    --ye-gray-200: #EDF0F4;
    --ye-gray-300: #D1D5DB;
    --ye-radius: 12px;
    --ye-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --ye-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--ye-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ye-text);
    background: var(--ye-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ye-primary); text-decoration: none; transition: all 0.2s; }
a:hover { color: var(--ye-primary-dark); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; }

/* ============ HEADER ============ */
.ye-header {
    background: var(--ye-white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.ye-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.ye-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ye-text);
}

.ye-logo-icon {
    width: 42px;
    height: 42px;
    background: var(--ye-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    font-weight: 800;
}

.ye-logo-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--ye-text);
}

.ye-logo-text span { color: var(--ye-primary); }

/* Navigation */
.ye-nav { display: flex; align-items: center; gap: 8px; }

.ye-nav a, .ye-nav button {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--ye-text);
    transition: all 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--ye-font);
}

.ye-nav a:hover { background: var(--ye-gray-100); color: var(--ye-primary); }

.ye-nav .ye-nav-btn-primary {
    background: var(--ye-primary);
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 10px;
}

.ye-nav .ye-nav-btn-primary:hover { background: var(--ye-primary-dark); }

.ye-nav .ye-nav-btn-outline {
    border: 2px solid var(--ye-gray-200);
    padding: 8px 18px;
}

.ye-nav .ye-nav-btn-outline:hover { border-color: var(--ye-primary); color: var(--ye-primary); }

/* Mobile menu */
.ye-menu-toggle { display: none; background: none; border: none; font-size: 28px; cursor: pointer; }

@media (max-width: 768px) {
    .ye-menu-toggle { display: block; }
    .ye-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--ye-white);
        padding: 16px;
        flex-direction: column;
        box-shadow: var(--ye-shadow);
    }
    .ye-nav.active { display: flex; }
    .ye-nav a, .ye-nav button { width: 100%; text-align: center; }
}

/* ============ HERO ============ */
.ye-hero {
    background: linear-gradient(135deg, var(--ye-secondary) 0%, #0F3460 100%);
    padding: 80px 24px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.ye-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,65,54,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.ye-hero h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    position: relative;
}

.ye-hero h1 span { color: var(--ye-primary); }

.ye-hero p {
    font-size: 20px;
    opacity: 0.85;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.ye-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--ye-primary);
    color: #fff;
    padding: 16px 36px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 8px 25px rgba(255,65,54,0.3);
}

.ye-hero-cta:hover {
    background: var(--ye-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255,65,54,0.4);
}

@media (max-width: 768px) {
    .ye-hero h1 { font-size: 32px; }
    .ye-hero p { font-size: 16px; }
    .ye-hero { padding: 50px 20px; }
}

/* ============ FEATURES SECTION ============ */
.ye-features {
    max-width: 1100px;
    margin: -40px auto 40px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    position: relative;
    z-index: 2;
}

.ye-feature-card {
    background: var(--ye-white);
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s;
}

.ye-feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }

.ye-feature-icon { font-size: 40px; margin-bottom: 12px; display: block; }
.ye-feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.ye-feature-card p { font-size: 14px; color: var(--ye-text-light); }

@media (max-width: 768px) {
    .ye-features { grid-template-columns: 1fr; margin-top: -20px; }
}

/* ============ CONTENT ============ */
.ye-main { min-height: 60vh; padding-bottom: 60px; }

/* ============ FOOTER ============ */
.ye-footer {
    background: var(--ye-secondary);
    color: #fff;
    padding: 48px 24px 24px;
}

.ye-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.ye-footer-brand p { opacity: 0.7; font-size: 14px; margin-top: 8px; }

.ye-footer-col h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    margin-bottom: 16px;
}

.ye-footer-col a {
    display: block;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    padding: 4px 0;
}

.ye-footer-col a:hover { color: #fff; }

.ye-footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .ye-footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
}

/* ============ SINGLE RESTAURANT ============ */
.ye-restaurant-header {
    background: var(--ye-white);
    padding: 24px;
    border-radius: 16px;
    margin: 24px auto;
    max-width: 1100px;
    display: flex;
    gap: 24px;
    box-shadow: var(--ye-shadow);
}

.ye-restaurant-hero-img {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    object-fit: cover;
    flex-shrink: 0;
}

.ye-restaurant-details h1 { font-size: 28px; margin-bottom: 8px; }
.ye-restaurant-details .ye-restaurant-cats { color: var(--ye-text-light); margin-bottom: 8px; }

.ye-menu-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.ye-menu-category-title {
    font-size: 20px;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ye-gray-200);
}

.ye-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.yaesta-product-card {
    background: var(--ye-white);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 16px;
    box-shadow: var(--ye-shadow);
    transition: all 0.2s;
}

.yaesta-product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.yaesta-product-img {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.yaesta-product-info { flex: 1; }
.yaesta-product-info h4 { margin: 0 0 4px; font-size: 16px; }
.yaesta-product-desc { font-size: 13px; color: var(--ye-text-light); margin-bottom: 8px; }

.yaesta-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.yaesta-product-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--ye-primary);
}

.yaesta-add-to-cart {
    padding: 8px 16px;
    background: var(--ye-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--ye-font);
}

.yaesta-add-to-cart:hover { background: var(--ye-primary-dark); }
.yaesta-add-to-cart.added { background: var(--ye-accent); }

/* ============ LOGIN/REGISTER OVERRIDE ============ */
.login h1 a { background-image: none !important; text-indent: 0 !important; font-size: 28px; font-weight: 800; }

/* ============ WP ADMIN BAR FIX ============ */
body.admin-bar .ye-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .ye-header { top: 46px; } }

/* ============ PWA / MOBILE ============ */
@media (max-width: 480px) {
    .ye-restaurant-header { flex-direction: column; }
    .ye-restaurant-hero-img { width: 100%; height: 180px; }
}
