/* 
   🎨 GOURMET PREMIUM DESIGN SYSTEM 
   ---------------------------------
   Un diseño elegante, limpio y profesional para Cafetería SENA.
*/

:root {
    /* Paleta de Colores Refinada - VINO TINTO & ORO */
    --primary: #800020;
    /* Burgundy (Vino Tinto) */
    --primary-dark: #500014;
    /* Deep Burgundy */
    --primary-light: #982b46;
    /* Lighter Burgundy for gradients */

    --accent: #D4AF37;
    /* Metallic Gold */
    --accent-hover: #E5C558;
    /* Lighter Gold */

    --bg-body: #F4F1EA;
    /* Creamy warm white (Carta antigua feel) */
    --bg-card: #FFFFFF;
    --bg-input: #Fdfcfc;

    --text-main: #2C1810;
    /* Dark Coffee Brown (Softer than black) */
    --text-light: #6D5B55;
    /* Warm Grey */
    --text-white: #FFFFFF;

    --success: #2E7D32;
    --danger: #C0392B;
    --warning: #F39C12;

    /* Sombras y Efectos 3D */
    --shadow-sm: 0 4px 6px rgba(44, 24, 16, 0.05);
    --shadow-md: 0 10px 20px rgba(44, 24, 16, 0.08);
    --shadow-lg: 0 20px 30px rgba(44, 24, 16, 0.12);
    --shadow-3d: 0 25px 50px -12px rgba(128, 0, 32, 0.25);

    --radius: 16px;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy 3D feel */
}

/* --- RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #F4F1EA 0%, #E8E0D5 100%);
    font-family: 'Lato', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    /* MAXIMUM SHARPNESS - PC & MOBILE */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
}

/* GLOBAL IMAGE QUALITY - SHARP & COMPLETE */
img {
    image-rendering: auto;
    /* Better than crisp-edges for photos */
    image-rendering: high-quality;
    -ms-interpolation-mode: bicubic;
    max-width: 100%;
    height: auto;
    display: block;
}

/* FORM SPACING IMPROVEMENTS */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group:last-of-type {
    margin-bottom: 2rem;
    /* Extra space before buttons */
}

button[type="submit"],
.btn-block {
    margin-top: 2rem !important;
    /* Ensure good spacing from last input */
}

/* REMOVE ALL UNDERLINES GLOBALLY */
a {
    text-decoration: none !important;
    color: inherit;
    transition: var(--transition);
}

a:hover {
    text-decoration: none !important;
}

h1,
h2,
h3,
h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary);

    /* MAXIMUM TEXT SHARPNESS */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-shadow: none;
    /* Remove shadow for maximum clarity */
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    font-weight: 400;
}

h2::after {
    display: none;
}

/* SHARP TEXT FOR ALL ELEMENTS */
p,
span,
div,
a,
label,
input,
button {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- LAYOUT & COMPONENTS --- */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 80px;
    width: 100%;
}

/* Header Premium */
.main-header {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--primary);
    /* Accent line */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.logo span {
    color: var(--accent);
    text-transform: uppercase;
}

.logo-img {
    height: 55px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.nav-btn {
    padding: 0.75rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    box-shadow: 0 10px 20px -10px rgba(128, 0, 32, 0.5);
    border: 2px solid transparent;
    position: relative;
    top: 0;
}

/* 3D Button Push Effect */
.btn-primary:active {
    top: 2px;
    box-shadow: 0 5px 10px -5px rgba(128, 0, 32, 0.5);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px -10px rgba(128, 0, 32, 0.6);
}

.btn-outline {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --- PRODUCT GRID & 3D CARDS --- */
.menu-section {
    padding: 4rem 0;
    perspective: 2000px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 3rem;
    margin-top: 2.5rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    transition: var(--transition);
    border: none;
    display: flex;
    flex-direction: column;
    position: relative;

    /* 3D Base State */
    transform-style: preserve-3d;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 10px 20px rgba(0, 0, 0, 0.05);
    border-bottom: 4px solid var(--accent);
    /* Elegant touch */
}

/* Simplified 3D HOVER - No blocking */
.product-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 15px 30px rgba(0, 0, 0, 0.12),
        0 5px 15px rgba(128, 0, 32, 0.1);
    z-index: 5;
}

.card-img-wrapper {
    width: 100%;
    min-height: 200px;
    max-height: 250px;
    position: relative;
    overflow: hidden;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fills the space while maintaining aspect ratio */
    object-position: center;
    transition: transform 0.8s ease;

    /* SMOOTH HIGH-QUALITY RENDERING */
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: bicubic;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.product-card:hover .card-img-wrapper img {
    transform: scale(1.1) translateZ(0);
}

.card-body {
    padding: 2.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFA 100%);
}

.card-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    line-height: 1.3;
}

.card-desc {
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 1.8rem;
    flex-grow: 1;
    line-height: 1.6;
    font-weight: 400;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.price-tag {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.btn-add {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    color: var(--primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    box-shadow: var(--shadow-sm);
    font-weight: bold;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.btn-add:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--accent);
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(128, 0, 32, 0.4);
    z-index: 20;
}

.btn-add:active {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #300010 100%);
    color: var(--accent);
    transform: scale(1.0);
    box-shadow: 0 4px 10px rgba(128, 0, 32, 0.5);
    transition: all 0.1s ease;
}

/* --- LOGIN PAGE --- */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4a0012 0%, #2c000b 100%);
    padding: 20px;
    perspective: 1500px;
}

.login-card {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    transform: rotateX(5deg);
    /* Initial slight tilt */
    transition: var(--transition);
    border-top: 5px solid var(--accent);
}

.login-card:hover,
.login-card:focus-within {
    transform: rotateX(0deg) translateY(-5px);
    box-shadow: 0 35px 60px rgba(0, 0, 0, 0.6);
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--primary);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-input);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
    color: var(--text-main);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: white;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
}

/* --- CART FLOATING --- */
.cart-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    width: 95px;
    height: 95px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-3d);
    cursor: pointer;
    transition: var(--transition);
    z-index: 900;
    border: none;
    animation: float 3s ease-in-out infinite;
    font-size: 2rem;
}

@keyframes float {
    0% {
        transform: translateY(0px);
        box-shadow: 0 5px 15px rgba(128, 0, 32, 0.4);
    }

    50% {
        transform: translateY(-10px);
        box-shadow: 0 25px 25px rgba(128, 0, 32, 0.2);
    }

    100% {
        transform: translateY(0px);
        box-shadow: 0 5px 15px rgba(128, 0, 32, 0.4);
    }
}

.cart-float:hover {
    animation-play-state: paused;
    transform: scale(1.15);
    background: var(--accent);
    color: var(--primary);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent);
    color: var(--primary);
    font-weight: bold;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 24, 16, 0.7);
    /* Brown tint */
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    perspective: 1000px;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius);
    padding: 2.5rem;
    position: relative;
    border-top: 6px solid var(--primary);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);

    transform: rotateX(20deg) translateY(50px) scale(0.9);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: rotateX(0deg) translateY(0) scale(1);
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: 0.2s;
}

.close-modal:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

/* ============================================
   📱 RESPONSIVE DESIGN
   ============================================ */

/* Mobile Enhancements */
@media (max-width: 768px) {

    .btn-primary:hover,
    .product-card:hover {
        transform: none;
        /* Disable heavy 3D on touch to prevent weird jumps */
    }

    .product-card {
        transform: none !important;
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 2rem;
    }
}

.container {
    padding: 0 12px;
}

.logo {
    font-size: 1rem;
}

.nav-btn {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 30px;
    min-height: 44px;
}

.card-img-wrapper {
    height: 140px;
}

.card-body {
    padding: 0.9rem;
}

.card-title {
    font-size: 1rem;
}

.price-tag {
    font-size: 1rem;
}

.login-card {
    padding: 1.25rem;
}

.form-input {
    padding: 10px 12px;
    font-size: 16px;
    min-height: 44px;
}

.cart-float {
    width: 52px;
    height: 52px;
    bottom: 12px;
    right: 12px;
}

.cart-count {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
}


/* iPhone SE y pantallas muy pequeñas (≤375px) */
@media (max-width: 375px) {
    h1 {
        font-size: 1.25rem;
    }

    h2 {
        font-size: 1.05rem;
    }

    .container {
        padding: 0 10px;
    }

    .main-header {
        padding: 0.6rem 0;
    }

    .header-content {
        gap: 0.5rem;
    }

    .logo {
        font-size: 0.95rem;
        gap: 5px;
    }

    .header-content nav {
        gap: 0.4rem;
    }

    .nav-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 25px;
        white-space: nowrap;
        min-height: 44px;
    }

    .product-grid {
        gap: 1rem;
    }

    .card-img-wrapper {
        height: 130px;
    }

    .card-body {
        padding: 0.8rem;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-desc {
        font-size: 0.8rem;
    }

    .price-tag {
        font-size: 0.95rem;
    }

    .btn-add {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .login-card {
        padding: 1rem;
        margin: 8px;
    }

    .login-icon {
        font-size: 2rem;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 16px;
        min-height: 44px;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .cart-float {
        width: 50px;
        height: 50px;
        bottom: 10px;
        right: 10px;
        font-size: 1.4rem;
    }

    .cart-count {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
        top: -2px;
        right: -2px;
    }

    .modal-content {
        width: 96%;
        padding: 1rem;
        margin: 2% auto;
    }

    .close-modal {
        font-size: 1.8rem;
        min-width: 44px;
        min-height: 44px;
    }

    /* Admin specific */
    .admin-container {
        padding: 0.5rem !important;
    }

    .admin-nav {
        padding: 0.5rem !important;
        gap: 0.4rem !important;
    }

    .admin-nav a {
        font-size: 0.7rem !important;
        padding: 0.5rem 0.3rem !important;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}