/* --- MERCHANDISE PAGE STYLING (GREEN BLEND) --- */

:root {
    /* Main Green Palette */
    --primary: #15803d;
    --secondary: #10b981;
    --btn-hover: #059669;
    --bg-accent: #f0fdf4;

    /* Neutrals */
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --border: #e2e8f0;
}

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

/* Hero Section */
.merch-hero {
    text-align: center;
    margin-bottom: 60px;
}

.merch-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.2;
}

.merch-hero p {
    color: var(--text-muted);
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.6;
    padding: 0 10px;
}

/* The Animated Underline */
.highlight {
    position: relative;
    color: var(--primary);
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    height: 5px;
    background: var(--secondary);
    width: 0;
    border-radius: 10px;
    animation: loadLine 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes loadLine {
    to {
        width: 100%;
    }
}

/* Product Grid */
.product-grid {
    display: grid;
    /* auto-fill ensures cards wrap naturally */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* Card Styling */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ensures all cards in a row are the same height */
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(21, 128, 61, 0.1);
}

/* Image Wrapper */
.image-wrapper {
    position: relative;
    height: 250px;
    background-color: #f1f5f9;
    flex-shrink: 0;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badges */
.badge {
    position: absolute;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.badge-tag {
    bottom: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    backdrop-filter: blur(4px);
}

.badge-purple {
    top: 12px;
    left: 12px;
    background: #9333ea;
    color: white;
}

.badge-alert {
    top: 12px;
    right: 12px;
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.badge-stock {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ef4444;
    color: white;
    padding: 10px 20px;
    width: auto;
    text-align: center;
}

/* Card Body */
.card-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    margin-top: auto;
    /* Pushes price and buttons to the bottom */
}



/* Buttons */
.btn {
    width: 100%;
    padding: 14px;
    /* Slightly taller for mobile */
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    margin-bottom: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-outline:hover {
    background: var(--bg-accent);
}

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

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

.btn-disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

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

/* --- TABLET (481px to 1024px) --- */
@media (min-width: 481px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .merch-hero h1 {
        font-size: 2.2rem;
    }

    .image-wrapper {
        height: 220px;
    }
}

/* --- MOBILE (Up to 480px) --- */
@media (max-width: 480px) {
    .merch-hero h1 {
        font-size: 1.8rem;
    }

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

    .image-wrapper {
        height: 300px;
    }

    /* Taller for full-width impact */

    .card {
        max-width: 100%;
    }
}