/* assets/css/styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --text-color: #374151;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

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

/* ===== LAYOUT GENERAL TIENDA ===== */

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

/* Header */
.header {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    background: var(--dark-color);
    color: #fff;
    padding: 10px 0;
    font-size: 0.875rem;
}

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

.contact-info span {
    margin-right: 20px;
}

.contact-info i,
.user-actions i {
    margin-right: 5px;
}

.user-actions a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
    transition: color 0.3s;
}

.user-actions a:hover {
    color: var(--accent-color);
}

.navbar {
    padding: 20px 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

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

.search-bar {
    flex: 0 0 400px;
}

.search-bar form {
    display: flex;
    background: var(--light-color);
    border-radius: 25px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    background: transparent;
    outline: none;
}

.search-bar button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: var(--secondary-color);
}

.nav-icons {
    display: flex;
    gap: 20px;
}

.nav-icon {
    position: relative;
    color: var(--dark-color);
    font-size: 1.5rem;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-icon:hover {
    color: var(--primary-color);
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    justify-content: center;
    gap: 30px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.nav-menu a {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-block {
    display: block;
    width: 100%;
}

/* Features */
.features {
    padding: 60px 0;
    background: var(--light-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Productos */
.products-section {
    padding: 80px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--dark-color);
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.view-all:hover {
    color: var(--secondary-color);
}

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

.product-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-color);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 10;
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 280px;
    background: var(--light-color);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 1.125rem;
    margin-bottom: 5px;
    color: var(--dark-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-category {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.product-rating {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.product-rating span {
    color: var(--text-color);
    font-size: 0.875rem;
    margin-left: 5px;
}

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

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

.price-old {
    font-size: 1.125rem;
    color: #9ca3af;
    text-decoration: line-through;
}

/* Newsletter */
.newsletter {
    background: var(--dark-color);
    color: #fff;
    padding: 60px 0;
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.newsletter-form input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 25px;
    outline: none;
}

/* Footer */
.footer {
    background: #111827;
    color: #9ca3af;
    padding: 60px 0 20px;
}

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

.footer-column h3,
.footer-column h4 {
    color: #fff;
    margin-bottom: 20px;
}

.footer-column p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: #fff;
    font-size: 1.5rem;
    transition: color 0.3s;
}

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

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

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: #fff;
}

.payment-methods {
    display: flex;
    gap: 15px;
    font-size: 2rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #374151;
}

/* ===== FORM GENÉRICO (panel admin / páginas varias) ===== */

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
}

/* Responsive general */
@media (max-width: 768px) {
    .nav-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    .search-bar {
        flex: 1;
        width: 100%;
    }
    .nav-menu {
        flex-wrap: wrap;
        gap: 15px;
    }
    .hero-title {
        font-size: 2rem;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* ===== CART PAGE ===== */
.page-header {
    background: #111827;
    color: #fff;
    padding: 32px 0;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.cart-page {
    padding: 40px 0 60px;
    background: #f3f4f6;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(320px, 0.9fr);
    gap: 24px;
    align-items: flex-start;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 18px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 6px 18px rgba(15,23,42,0.08);
    align-items: center;
}

.cart-item-image img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
}

.cart-item-info h3 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: #111827;
}

.cart-item-price-unit {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #2563eb;
}

.cart-item-remove {
    border: none;
    background: none;
    color: #6b7280;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cart-item-remove:hover {
    color: #ef4444;
}

.cart-item-qty-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.cart-item-qty {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #f3f4f6;
    padding: 4px;
}

.cart-item-qty input {
    width: 46px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 0.9rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: #e5e7eb;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #d1d5db;
}

.cart-item-total {
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
}

/* Resumen */
.cart-summary {
    background: #fff;
    border-radius: 16px;
    padding: 18px 18px 20px;
    box-shadow: 0 12px 30px rgba(15,23,42,0.15);
    position: sticky;
    top: 96px;
}

.cart-summary h2 {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    color: #111827;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin: 6px 0;
}

.summary-divider {
    border-top: 1px solid #e5e7eb;
    margin: 10px 0 8px;
}

.summary-total {
    font-weight: 700;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
    border-radius: 999px;
    padding: 10px 0;
}

/* Carrito vacío */
.empty-cart {
    background: #fff;
    border-radius: 16px;
    padding: 50px 20px;
    text-align: center;
    box-shadow: 0 16px 30px rgba(15,23,42,0.12);
}

.empty-cart i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 12px;
}

.empty-cart h2 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.empty-cart p {
    color: #6b7280;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        grid-template-columns: 80px minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 12px;
    }

    .cart-item-qty-total {
        flex-direction: row;
        justify-content: space-between;
        grid-column: 1 / -1;
    }

}
