/**
 * [Your Site Name] - Main Stylesheet
 * 
 * Architecture:
 * 1. Custom Properties (Variables)
 * 2. Base Styles
 * 3. Components
 *    - Affiliate Disclosure
 *    - Global Header
 *    - Mobile Navigation
 *    - Product Cards
 *    - Pagination
 * 4. Global Footer
 * 5. Media Queries
 */

/* ==========================================================================
   1. Custom Properties (Variables)
   ========================================================================== */
:root {
    --bg-color: #F9F8F6;
    --text-main: #2C2C2C;
    --accent-forest-green: #3A7D44;
    --accent-forest-green-hover: #2C5E3B;
    --heart-liked: #D9534F;
    --card-bg: #FFFFFF;
}

/* ==========================================================================
   2. Base Styles
   ========================================================================== */
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    
/* Multi-layered background composite... */
    background-image: 
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E"),
        linear-gradient(rgba(249, 248, 246, 0.6), rgba(249, 248, 246, 0.85)),
        url('../img/bg-image.jpg');
    
    background-attachment: fixed;
    background-size: auto, cover, cover;
    background-position: center;
    
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   3. Components
   ========================================================================== */

/* --- Affiliate Disclosure --- */
.disclosure {
    text-align: center;
    font-size: 12px;
    font-style: italic;
    padding: 15px;
    background-color: var(--bg-color);
    opacity: 0.8;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* --- Global Header --- */
header {
    position: sticky;
    top: 0;
    background-color: rgba(249, 248, 246, 0.95);
    backdrop-filter: blur(5px);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    min-height: 36px;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
}

.header-left, .header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-right {
    justify-content: flex-end;
    gap: 20px;
}

/* Brand Identity */
.logo-img {
    max-height: 60px;
    width: auto;
    display: block;
}

.logo {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 24px;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Desktop Search Interface */
.search-bar {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    background: transparent;
    outline: none;
    width: 200px;
}

.search-bar:focus {
    border-color: var(--text-main);
}

.header-links a {
    text-decoration: none;
    color: var(--text-main);
    font-family: 'Space Mono', monospace;
    font-size: 14px;
}

/* --- Mobile Navigation & Interactive Elements --- */
.mobile-only {
    display: none !important;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-dropdown {
    display: none;
    position: absolute;
    top: 100%; /* Positions dropdown flush with the bottom edge of the sticky header */
    left: 0;
    width: 100%; /* Forces full viewport width regardless of parent container */
    box-sizing: border-box; 
    background-color: rgba(249, 248, 246, 0.98);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); /* Depth elevation for dropdown menu */
    padding: 15px 20px;
    text-align: center;
}

.mobile-dropdown.active {
    display: block;
}

.mobile-dropdown a {
    display: block;
    padding: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    border-bottom: 1px dashed #ccc;
}

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

.mobile-search-input {
    width: 100%;
    box-sizing: border-box;
}

/* --- Layout Container & Product Grid --- */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    flex-grow: 1;
    width: 100%;
    box-sizing: border-box;
}

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

/* --- Product Card Component --- */
.card {
    background: var(--card-bg);
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #d4af37, #9b7523, #aa7c11) 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.image-container {
    width: 100%;
    aspect-ratio: 5 / 4;
    overflow: hidden;
    position: relative;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* Like/Save Interactive Element */
.heart-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    z-index: 10;
}

.heart-btn:hover {
    transform: scale(1.1);
}

.heart-icon {
    fill: none;
    stroke: var(--text-main);
    stroke-width: 2;
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.heart-btn.liked .heart-icon {
    fill: var(--heart-liked);
    stroke: var(--heart-liked);
}

/* Card Typography & Layout */
.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tag {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.title-container {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 0 15px 0;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 15px;
}

.title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.price {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-forest-green);
}

.description {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Call to Action Button */
.buy-btn {
    background-color: var(--accent-forest-green);
    color: white;
    text-align: center;
    text-decoration: none;
    padding: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.buy-btn:hover {
    background-color: var(--accent-forest-green-hover);
}

/* --- Pagination Controls --- */
.load-more-container {
    text-align: center;
    margin: 50px 0;
}

.load-more {
    background: transparent;
    border: 1px solid var(--text-main);
    padding: 15px 40px;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more:hover {
    background: var(--text-main);
    color: white;
}

/* --- Text Page Styles --- */
.text-page-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    
    /* The Brass Gradient Border */
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #d4af37, #9b7523, #aa7c11) 1;
}
.text-page-container h1 {
    font-size: 32px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-forest-green);
    padding-bottom: 10px;
    display: inline-block;
}
.text-page-container h2 {
    font-size: 20px;
    margin-top: 40px;
    margin-bottom: 15px;
}
.text-page-container p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #444;
}

/* ==========================================================================
   4. Global Footer
   ========================================================================== */
footer {
    background-color: #1a1a1a;
    color: #ccc;
    text-align: center;
    padding: 30px 20px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    margin-top: auto;
}

footer a {
    color: #ccc;
    text-decoration: none;
    margin: 0 10px;
}

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

/* ==========================================================================
   5. Media Queries
   ========================================================================== */

/* Tablet & Mobile Viewports */
@media (max-width: 850px) {
    header {
        padding: 15px 20px;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
    
    .logo {
        font-size: 20px;
    }
}

/* State Management: Ensure mobile menus remain hidden on desktop viewports */
@media (min-width: 851px) {
    .mobile-dropdown {
        display: none !important;
    }
}