/* ============================================
   CSS Variables - Amazon-Inspired Theme
   ============================================ */
:root {
    /* Corporate Color Palette */
    --primary-accent: #0073e6; /* A professional blue */
    --primary-accent-hover: #005bb5;
    --secondary-accent: #f0f2f5; /* Light gray for backgrounds */
    --background-color: #f0f2f5;
    --surface-color: #FFFFFF;
    --text-primary: #1c1c1c; /* Dark gray for text */
    --text-secondary: #5a5a5a;
    --border-color: #dcdcdc;
    --success-green: #2e8540;
    --rating-star: #ffb400;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 3px;
    --radius-md: 5px;
    --radius-lg: 8px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ============================================
   Base Styles & Reset
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body.preload * {
    animation-duration: 0s !important;
    transition: none !important;
}

/* ============================================
   Header Styles
   ============================================ */
header {
    background: var(--surface-color);
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.search-wrapper {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-md);
}

/* ============================================
   Search Bar Styles - Amazon Style
   ============================================ */
.search-container {
    position: relative;
    width: 100%;
    max-width: 800px;
}

#searchBar {
    width: 100%;
    padding: 0.75rem 3.5rem 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--surface-color);
    color: var(--text-primary);
}

#searchBar::placeholder {
    color: #888;
}

#searchBar:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.3);
}

.search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: var(--amazon-orange);
    border: none;
    padding: 0 1.5rem;
    cursor: pointer;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: background 0.3s ease;
}

.search-button:hover {
    background: var(--amazon-orange-dark);
}

.search-button svg {
    width: 20px;
    height: 20px;
    fill: #111;
}

/* ============================================
   Main Content
   ============================================ */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.urgency-banner {
    background: linear-gradient(135deg, #c62828 0%, #e53935 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: bold;
    margin-bottom: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.social-proof {
    background-color: var(--surface-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--success-green);
}

.social-proof h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* ============================================
   Product Grid
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* ============================================
   Product Card Styles
   ============================================ */
.product-card {
    background-color: var(--surface-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card[data-bestseller="true"]::before {
    content: '🏆 BEST SELLER';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-green);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 1;
}

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

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    background-color: white;
    padding: var(--spacing-sm);
}

.product-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

.product-card h3:hover {
    color: var(--amazon-orange);
    cursor: pointer;
}

.product-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    flex-grow: 1;
}

.product-savings {
    color: var(--success-green);
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.product-prime {
    color: var(--secondary-accent);
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-shipping {
    color: var(--success-green);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-md);
}

/* ============================================
   Rating Styles
   ============================================ */
.rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
}

.stars {
    color: var(--rating-star);
    letter-spacing: 2px;
}

.rating-count {
    color: var(--secondary-accent);
    font-size: 0.9rem;
    text-decoration: none;
}

.rating-count:hover {
    color: var(--amazon-orange);
    text-decoration: underline;
}

/* ============================================
   Button Styles - Amazon Inspired
   ============================================ */
.affiliate-button {
    display: inline-block;
    background: linear-gradient(to bottom, #f3a847, #f0960e);
    color: #111;
    padding: 0.675rem 2rem;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.16);
    text-align: center;
    border: 1px solid #a88734;
    font-size: 1rem;
    margin-top: var(--spacing-sm);
}

.affiliate-button:hover {
    background: linear-gradient(to bottom, #f5b15c, #f5a83b);
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
    transform: translateY(-1px);
}

.affiliate-button:active {
    background: linear-gradient(to bottom, #e88b00, #e77600);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) inset;
}

.view-details-button {
    display: inline-block;
    background-color: transparent;
    color: var(--secondary-accent);
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    text-align: center;
    margin-right: var(--spacing-sm);
    cursor: pointer;
    font-size: 0.9rem;
}

.view-details-button:hover {
    background-color: var(--surface-light);
    border-color: var(--secondary-accent);
}

/* ============================================
   Trust Badges
   ============================================ */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   Modal Styles
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--surface-color);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-button {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: var(--primary-accent);
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-right: 2rem;
}

.review-section {
    margin: var(--spacing-lg) 0;
}

.review-section h3 {
    color: var(--primary-accent);
    margin-bottom: var(--spacing-md);
    font-size: 1.3rem;
}

.review-section ul {
    list-style: none;
    padding: 0;
}

.review-section li {
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    background-color: var(--surface-color);
    border-left: 3px solid var(--primary-accent);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.review-section li::before {
    content: '✓ ';
    color: var(--success-green);
    font-weight: bold;
    margin-right: var(--spacing-xs);
}

.review-section:last-child li {
    border-left-color: #c62828;
}

.review-section:last-child li::before {
    content: '⚠ ';
    color: #f44336;
}

/* ============================================
   Footer
   ============================================ */
footer {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: var(--spacing-xl);
    background-color: var(--surface-color);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .trust-badges {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: center;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    #searchBar {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .modal-content {
        padding: var(--spacing-md);
        max-width: 95%;
    }
    
    .affiliate-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-accent);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-accent-hover);
}
