/* 
   Huellita Pet Shop - Estilos Globales Definidos
   Paleta: Beige cálido, Terracota suave, Verde salvia.
*/

:root {
    --beige: #F9F7F2;
    --terracotta: #E2725B;
    --sage: #8A9A5B;
    --dark: #2B2B2B;
    --white: #FFFFFF;
    --cream: #FFFDF9;
    --gray-light: #f4f4f4;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--beige);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .logo {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
}

/* Navegación Sticky */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000; /* Debajo del carrito */
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 1.6rem;
    color: var(--terracotta);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--sage);
    font-weight: 400;
    font-size: 0.9rem;
}

.cart-icon {
    cursor: pointer;
    font-size: 1.5rem;
    position: relative;
    padding: 5px;
}

#cart-count {
    position: absolute;
    top: -2px;
    right: -5px;
    background: var(--terracotta);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 50px;
    font-weight: 700;
    border: 2px solid white;
}

/* Hero Section */
.hero {
    padding: 60px 20px 80px;
    text-align: center;
    background: linear-gradient(135deg, rgba(226, 114, 91, 0.08) 0%, rgba(138, 154, 91, 0.08) 100%);
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: var(--dark);
}

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

.hero p {
    font-size: 1rem;
    color: #666;
    max-width: 500px;
    margin: 0 auto;
}

.badge {
    background: var(--sage);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Buscador (Search Container) */
.search-container {
    max-width: 900px;
    margin: -35px auto 40px;
    padding: 0 20px;
    position: relative;
    z-index: 100;
}

.search-box {
    background: white;
    padding: 12px;
    border-radius: 50px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-box input, .search-box select {
    flex: 1;
    min-width: 140px;
    padding: 10px 18px;
    border: 1px solid #f0f0f0;
    border-radius: 30px;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
}

.search-box input:focus {
    border-color: var(--sage);
}

.btn-search {
    background: var(--terracotta);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.btn-search:hover {
    background: var(--dark);
    transform: scale(1.03);
}

/* Características Rápidas */
.features {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.feature-item {
    text-align: center;
    font-size: 0.85rem;
    color: #777;
}

.feature-item span {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 5px;
}

/* Grid de Productos */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
}

#product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (min-width: 768px) {
    #product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

/* Tarjeta de Producto */
.product-card {
    background: var(--white);
    border-radius: 18px;
    padding: 12px;
    transition: 0.3s ease;
    position: relative;
    border: 1px solid rgba(0,0,0,0.03);
}

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

.category-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 10px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--sage);
    text-transform: uppercase;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Contenedor de Imagen Cuadrada */
.img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 14px;
    background: #fdfdfd;
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.product-info {
    padding: 12px 2px 5px;
}

.product-info h3 {
    font-size: 0.88rem;
    margin-bottom: 8px;
    height: 42px;
    overflow: hidden;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.price {
    font-weight: 700;
    color: var(--terracotta);
    font-size: 1.1rem;
}

.stock-tag {
    font-size: 0.65rem;
    color: #aaa;
    font-weight: 500;
}

.add-btn {
    width: 100%;
    background: var(--sage);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.3s;
}

.add-btn:hover {
    background: var(--dark);
}

/* Carrito Lateral (Sidebar) */
#cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    background: var(--white);
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    z-index: 9000; /* Debajo de SweetAlert */
}

.cart-hidden {
    transform: translateX(100%);
}

.cart-header {
    padding: 20px;
    background: var(--cream);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #bbb;
}

#cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Footer del Carrito e Info del Cliente */
.cart-footer {
    padding: 20px;
    background: var(--cream);
    border-top: 1px solid #f0f0f0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.total-price {
    color: var(--terracotta);
}

.client-info {
    margin: 15px 0;
}

.client-info label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
}

.input-name {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: 0.3s;
}

.input-name:focus {
    border-color: var(--sage);
    background: white;
}

.btn-whatsapp {
    width: 100%;
    background: #25D366;
    color: white;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-whatsapp:hover {
    background: #1eb954;
    transform: translateY(-2px);
}

.whatsapp-note {
    font-size: 0.65rem;
    text-align: center;
    margin-top: 10px;
    color: #999;
}

/* Ubicación y Mapa */
.location-section {
    background: var(--white);
    padding: 50px 20px;
}

.location-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .location-container {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

.map-container {
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.btn-instagram {
    display: inline-block;
    margin-top: 10px;
    color: var(--terracotta);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--terracotta);
}

/* SWEETALERT GLOBAL FIX */
/* Aseguramos que los avisos siempre tapen el carrito en celular */
.swal2-container {
    z-index: 10000 !important;
}

/* Panel Admin Estilos */
.admin-container {
    max-width: 1100px;
    margin: 20px auto;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.tag-categoria {
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: #666;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.img-preview {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 8px;
    background: #eee;
}