/* ============================================
   TIENDA ONLINE - ESTILOS
   planificatuhuerto.com
   ============================================ */

:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #C8E6C9;
    --secondary-color: #FF9800;
    --danger-color: #f44336;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --bg-light: #f9f9f9;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

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

body {
    font-family: "Outfit","Outfit Fallback";
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1002;
    padding: 1rem 0;
}

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

.nav-logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.cart-link {
    position: relative;
    font-size: 1.2rem;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* ============================================
   HERO SECTION
   ============================================ */

.store-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.store-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.store-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumbs {
    background: var(--bg-light);
    padding: 1rem 0;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* ============================================
   FILTROS
   ============================================ */

.filters-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.filters-container {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
}

.filter-group select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

/* ============================================
   PRODUCTOS GRID
   ============================================ */

.products-section {
    padding: 3rem 0;
    flex: 1;
}

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

.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

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

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: var(--bg-light);
}

.product-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.badge-category {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.badge-destacado {
    background: #FFF3E0;
    color: #E65100;
}

.badge-novedad {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-oferta {
    background: #FFEBEE;
    color: #C62828;
}

.product-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.product-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.product-price {
    display: flex;
    flex-direction: column;
}

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

.price-original {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.stock-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.stock-disponible {
    background: #E8F5E9;
    color: #2E7D32;
}

.stock-bajo {
    background: #FFF3E0;
    color: #E65100;
}

.stock-agotado {
    background: #FFEBEE;
    color: #C62828;
}

/* ============================================
   BOTONES
   ============================================ */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
}

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

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

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

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   DETALLE DE PRODUCTO
   ============================================ */

.product-detail {
    padding: 3rem 0;
    flex: 1;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.product-images {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.thumbnails {
    display: flex;
    gap: 1rem;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
}

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

.product-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.product-meta {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.product-meta p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.product-price-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.price-oferta {
    font-size: 1.2rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.product-actions {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.quantity-selector {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    background: white;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s;
}

.qty-btn:hover {
    background: var(--bg-light);
}

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

.product-description-full {
    margin-top: 2rem;
    line-height: 1.8;
}

.related-products {
    margin-top: 4rem;
}

.related-products h2 {
    margin-bottom: 2rem;
}

/* ============================================
   CARRITO
   ============================================ */

.cart-section {
    padding: 3rem 0;
    flex: 1;
}

.cart-section h1 {
    margin-bottom: 2rem;
}

.empty-cart {
    text-align: center;
    padding: 4rem 0;
}

.empty-cart p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.cart-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.cart-items-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.cart-table {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

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

.cart-table th {
    background: var(--bg-light);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.cart-table td {
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border-color);
}

.cart-item-product {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.cart-item-sku {
    font-size: 0.85rem;
    color: var(--text-light);
}

.cart-quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-quantity-selector button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.cart-quantity-selector input {
    width: 50px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem;
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-remove:hover {
    background: #d32f2f;
}

.cart-summary {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    border-bottom: none;
    padding-top: 1rem;
}

.cart-summary .btn {
    margin-top: 1rem;
}

/* ============================================
   CHECKOUT
   ============================================ */

.checkout-section {
    padding: 3rem 0;
    flex: 1;
}

.checkout-section h1 {
    margin-bottom: 2rem;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.checkout-form {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

.checkout-form h2 {
    font-size: 1.3rem;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.checkout-form h2:first-child {
    margin-top: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.payment-option input[type="radio"] {
    width: auto;
}

.payment-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--primary-color);
}

.order-summary {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.order-summary h2 {
    margin-bottom: 1.5rem;
}

.order-items {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.order-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.order-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.order-item-info {
    flex: 1;
}

.order-item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.order-item-info p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.summary-totals {
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
}

/* ============================================
   CONFIRMACIÓN
   ============================================ */

.confirmation-section {
    padding: 4rem 0;
    flex: 1;
    display: flex;
    align-items: center;
}

.confirmation-box {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.confirmation-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.confirmation-box h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.confirmation-message {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.order-details {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    text-align: left;
}

.order-details h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.order-details p {
    margin: 0.5rem 0;
}

.next-steps {
    text-align: left;
    margin: 2rem 0;
}

.next-steps h3 {
    margin-bottom: 1rem;
}

.next-steps ol {
    padding-left: 1.5rem;
}

.next-steps li {
    margin: 0.75rem 0;
    line-height: 1.6;
}

.confirmation-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* ============================================
   ESTADOS
   ============================================ */

.loader {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.hidden {
    display: none !important;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

/* ============================================
   FOOTER
   ============================================ */

.store-footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 968px) {
    .product-detail-content {
        grid-template-columns: 1fr;
    }

    .cart-items-container {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

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

    .order-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .store-hero h1 {
        font-size: 2rem;
    }

    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }

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

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

    .confirmation-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-actions {
        flex-direction: column;
    }

    .quantity-selector {
        justify-content: center;
    }
}

/* ============================================
   SECCIÓN AMAZON AFFILIATES
   ============================================ */

.amazon-section {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.05), rgba(76, 175, 80, 0.05));
    padding: 4rem 0;
    margin-top: 3rem;
    border-top: 2px solid var(--secondary-color);
}

/* Amazon Productos - Header */
.amazon-products-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #ff8c00 100%);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.2);
}

.amazon-products-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.amazon-products-header p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 500;
}

.amazon-products-subtitle {
    font-size: 1rem !important;
    opacity: 0.9 !important;
    font-weight: 400 !important;
    margin-top: 0.5rem !important;
}

/* Nota de afiliado */
.amazon-affiliate-note {
    background: #e8f4f8;
    border-left: 4px solid var(--secondary-color);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 0.9rem;
    line-height: 1.6;
}

.amazon-affiliate-note strong {
    color: var(--secondary-color);
}

/* Amazon Productos - Carrusel Simple */
.amazon-products-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.amazon-category {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.amazon-category:hover {
    box-shadow: var(--shadow-hover);
}

.category-header {
    margin-bottom: 1.5rem;
}

.category-header h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.amazon-category-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Contenedor scrolleable de productos */
.products-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) var(--bg-light);
}

.products-scroll::-webkit-scrollbar {
    height: 6px;
}

.products-scroll::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

.products-scroll::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 10px;
}

.products-scroll::-webkit-scrollbar-thumb:hover {
    background: #ff9900;
}

/* Producto individual */
.product-item {
    flex: 0 0 auto;
    min-width: 240px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.product-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    min-height: 100px;
}

.product-item:hover .product-box {
    border-color: var(--secondary-color);
    background: rgba(255, 153, 0, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.15);
}

.product-box .product-name {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    font-size: 0.95rem;
}

.product-box .amazon-badge {
    font-size: 0.75rem;
    background: var(--secondary-color);
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* Imágenes de categorías */
.category-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.category-header .category-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.category-header .category-info {
    flex: 1;
}

.category-header h3 {
    margin: 0 0 0.5rem 0;
}

/* Imágenes de productos */
.product-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.product-image-placeholder {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 4px;
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .amazon-products-header {
        padding: 1.5rem 1rem;
    }

    .amazon-products-header h2 {
        font-size: 1.4rem;
    }

    .amazon-products-header p {
        font-size: 0.85rem;
    }

    .amazon-affiliate-note {
        font-size: 0.85rem;
        padding: 0.8rem 1rem;
        margin-bottom: 1.5rem;
    }

    .amazon-category {
        padding: 1rem;
    }

    .product-item {
        min-width: 200px;
    }

    .product-box {
        padding: 0.75rem;
        min-height: 90px;
    }

    .product-box .product-name {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .product-item {
        min-width: 160px;
    }

    .product-box {
        padding: 0.5rem;
        min-height: 80px;
    }

    .product-box .product-name {
        font-size: 0.8rem;
    }

    .amazon-category {
        padding: 1rem 0.75rem;
    }
}
