/* ============================================
   Esencial Verano - Amazon.es Affiliate Website
   style.css
   ============================================ */

:root {
    --primary-color: #FF9900;
    --primary-dark: #E8890C;
    --text-color: #2D3748;
    --text-light: #718096;
    --bg-color: #F7FAFC;
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Header
   ============================================ */
.site-header {
    background: linear-gradient(135deg, #FF9900 0%, #F5811F 50%, #E8750A 100%);
    color: #fff;
    padding: 2.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.site-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.site-header p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

/* ============================================
   Main container
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Section heading */
.section-heading {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-heading h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.section-heading p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Product Grid
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* ============================================
   Product Card
   ============================================ */
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

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

/* Product Image */
.product-image-wrapper {
    background: #F9FAFB;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    min-height: 280px;
    max-height: 340px;
}

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

/* Product Body */
.product-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

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

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

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

/* Buy Button */
.buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    transition: background-color 0.25s ease, transform 0.15s ease;
    border: none;
    cursor: pointer;
    gap: 0.5rem;
    width: 100%;
    text-align: center;
}

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

.buy-btn:active {
    transform: translateY(0);
}

.buy-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: #1a202c;
    color: #A0AEC0;
    text-align: center;
    padding: 2.5rem 1rem;
    margin-top: 3rem;
}

.site-footer p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

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

.site-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   Loading state
   ============================================ */
.loading {
    text-align: center;
    padding: 3rem;
}

.loader {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* Tablet */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
        gap: 1.5rem;
    }

    .container {
        padding: 2rem 1rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .product-image-wrapper {
        min-height: 240px;
    }

    .product-image-wrapper img {
        min-height: 240px;
        max-height: 280px;
    }

    .product-body {
        padding: 1.25rem;
    }

    .site-header {
        padding: 2rem 1rem;
    }
}

/* ============================================
   Utility
   ============================================ */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}
