/* ==========================================
   Tienda Navolato - Estilos Principales
   ========================================== */

:root {
    --primary-color: #1a5f2a;
    --primary-dark: #134a20;
    --primary-light: #2d8b3e;
    --secondary-color: #f5a623;
    --secondary-dark: #d4891c;
    --accent-color: #e74c3c;
    --text-color: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #2c2c2c;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 5px 20px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

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

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

/* ==========================================
   Header & Navigation
   ========================================== */

.header {
    background: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary-color);
    color: white;
    padding: 8px 0;
    font-size: 14px;
}

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

.header-top a {
    color: white;
    margin-left: 15px;
}

.header-top a:hover {
    color: var(--secondary-color);
}

.header-main {
    padding: 15px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 50px;
}

.logo h1 {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 700;
}

.logo span {
    color: var(--secondary-color);
}

.search-box {
    flex: 1;
    max-width: 500px;
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    font-size: 14px;
    outline: none;
}

.search-box button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--primary-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.header-action:hover {
    background: var(--bg-light);
}

.header-action i {
    font-size: 22px;
    color: var(--primary-color);
}

.header-action span {
    font-size: 14px;
    color: var(--text-light);
}

.cart-badge {
    position: relative;
}

.cart-badge .count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
}

.nav-main {
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.nav-main ul {
    display: flex;
    list-style: none;
    justify-content: center;
    padding: 0;
}

.nav-main li {
    position: relative;
}

.nav-main a {
    display: block;
    padding: 15px 25px;
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
}

.nav-main a:hover,
.nav-main a.active {
    color: var(--primary-color);
    background: var(--bg-light);
}

.nav-main .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius) var(--radius);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.nav-main li:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

/* Mobile menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--primary-color);
}

/* ==========================================
   Slider / Hero
   ========================================== */

.slider {
    position: relative;
    overflow: hidden;
    max-height: 500px;
}

.slider-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.slide-content h2 {
    font-size: 48px;
    margin-bottom: 15px;
}

.slide-content p {
    font-size: 20px;
    margin-bottom: 25px;
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.slider-dot.active,
.slider-dot:hover {
    background: white;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: var(--primary-color);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.slider-arrow:hover {
    background: var(--primary-color);
    color: white;
}

.slider-arrow.prev {
    left: 20px;
}

.slider-arrow.next {
    right: 20px;
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

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

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

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-cart {
    background: var(--secondary-color);
    color: white;
    width: 100%;
}

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

.btn-sm {
    padding: 8px 20px;
    font-size: 12px;
}

.btn-lg {
    padding: 15px 40px;
    font-size: 16px;
}

/* ==========================================
   Products Grid
   ========================================== */

.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 32px;
    color: var(--text-color);
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-light);
    font-size: 16px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

.product-badge.oferta {
    background: var(--accent-color);
}

.product-badge.nuevo {
    background: var(--primary-color);
}

.product-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

.product-actions button,
.product-actions a {
    flex: 1;
    padding: 10px;
    background: white;
    color: var(--text-color);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: var(--transition);
}

.product-actions button:hover,
.product-actions a:hover {
    background: var(--primary-color);
    color: white;
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price-current {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.price-old {
    font-size: 16px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-stock {
    font-size: 13px;
    color: var(--success-color);
}

.product-stock.low {
    color: var(--warning-color);
}

.product-stock.out {
    color: var(--error-color);
}

/* ==========================================
   Product Detail
   ========================================== */

.product-detail {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    margin: 40px 0;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.product-gallery {
    display: flex;
    gap: 15px;
}

.gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 80px;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: var(--primary-color);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-main {
    flex: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.gallery-main img {
    width: 100%;
    height: 450px;
    object-fit: cover;
}

.product-detail-info h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

.product-detail-info .product-category {
    margin-bottom: 15px;
}

.product-detail-info .product-price {
    font-size: 28px;
    margin-bottom: 20px;
}

.product-detail-info .price-current {
    font-size: 32px;
}

.product-description {
    color: var(--text-light);
    margin-bottom: 25px;
    line-height: 1.8;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.quantity-selector label {
    font-weight: 600;
}

.quantity-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.quantity-input button {
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.quantity-input button:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-input input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-size: 16px;
}

.product-meta {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}

.product-meta p {
    margin-bottom: 10px;
    color: var(--text-light);
}

.product-meta strong {
    color: var(--text-color);
}

/* ==========================================
   Cart
   ========================================== */

.cart-page {
    padding: 40px 0;
}

.cart-table {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cart-table table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th,
.cart-table td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.cart-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-color);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
}

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

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-item-title {
    font-weight: 600;
}

.cart-item-remove {
    color: var(--error-color);
    cursor: pointer;
    font-size: 18px;
}

.cart-summary {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.cart-summary h3 {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.cart-summary-row.total {
    font-size: 20px;
    font-weight: 700;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
    margin-top: 15px;
}

/* ==========================================
   Forms
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 42, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-error {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 5px;
}

/* ==========================================
   Checkout
   ========================================== */

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

.checkout-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.checkout-section h3 {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.payment-method:hover {
    border-color: var(--primary-color);
}

.payment-method.selected {
    border-color: var(--primary-color);
    background: rgba(26, 95, 42, 0.05);
}

.payment-method input {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.payment-method-info {
    flex: 1;
}

.payment-method-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.payment-method-desc {
    font-size: 13px;
    color: var(--text-light);
}

.payment-method-icon {
    font-size: 30px;
    color: var(--primary-color);
}

.shipping-zones {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.shipping-zone {
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.shipping-zone:hover {
    border-color: var(--primary-color);
}

.shipping-zone.selected {
    border-color: var(--primary-color);
    background: rgba(26, 95, 42, 0.05);
}

.shipping-zone-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.shipping-zone-price {
    color: var(--primary-color);
    font-weight: 600;
}

/* ==========================================
   Auth Pages
   ========================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.auth-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
}

.auth-box .logo {
    justify-content: center;
    margin-bottom: 30px;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-links a {
    color: var(--primary-color);
    font-weight: 600;
}

/* ==========================================
   Alerts
   ========================================== */

.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ==========================================
   Footer
   ========================================== */

.footer {
    background: var(--bg-dark);
    color: white;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.footer-col p {
    color: #aaa;
    margin-bottom: 15px;
    line-height: 1.8;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul a {
    color: #aaa;
    transition: var(--transition);
}

.footer-col ul a:hover {
    color: white;
    padding-left: 5px;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

.payment-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.payment-icons img {
    height: 30px;
    opacity: 0.7;
    transition: var(--transition);
}

.payment-icons img:hover {
    opacity: 1;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-top {
        display: none;
    }

    .header-main .container {
        flex-wrap: wrap;
    }

    .search-box {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 15px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-main ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: var(--shadow-lg);
    }

    .nav-main ul.active {
        display: flex;
    }

    .nav-main a {
        border-bottom: 1px solid var(--border-color);
    }

    .slide-content h2 {
        font-size: 28px;
    }

    .slide-content p {
        font-size: 16px;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .shipping-zones {
        grid-template-columns: 1fr;
    }

    .product-gallery {
        flex-direction: column-reverse;
    }

    .gallery-thumbs {
        flex-direction: row;
        width: 100%;
    }

    .cart-table {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 10px;
    }

    .header-action span {
        display: none;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .auth-box {
        padding: 25px;
    }
}

/* ==========================================
   Utilities
   ========================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.hidden { display: none; }
.visible { display: block; }

/* Loading spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
