/* ========== Global & Layout ========== */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* ========== Catalog Header ========== */
.catalog-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.catalog-header h1 {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin: 0.5rem 0;
    letter-spacing: -1px;
}

.badge-soft {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* ========== Controls (Search + Filter) ========== */
.catalog-controls {
    max-width: 700px;
    margin: 2rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.search-form {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    min-width: 300px;
    color: #999;
}

.search-input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.1);
}

.icon {
    color: #2E7D32;
}

.search-input-wrapper .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
}

.filter-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.pill {
    text-decoration: none;
    color: #555;
    border: 1px solid #e0e0e0;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pill:hover {
    border-color: #bbb;
    background: #f9f9f9;
}

.pill.active {
    background: #2e7d32;
    color: white;
    border-color: #2e7d32;
}

/* ========== Product Grid (List View) ========== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 3rem;
    justify-content: center;
}

.product-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: #d0e7d2;
}

/* --- FIXED CARD IMAGE (Bulletproof) --- */
.product-card .card-image-container {
    height: 180px; /* Fixed height */
    width: 100%;
    position: relative;
    overflow: hidden; /* Cuts off anything too big */
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card .card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fills the box nicely */
    transition: transform 0.3s ease;
    display: block;
}

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

/* Icon Placeholder Area (Fallback) */
.card-icon-placeholder {
    height: 180px; /* Match the image container height */
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

.card-icon-placeholder.flower {
    background: #f1f8e9;
    color: #a5d6a7;
}

.card-icon-placeholder.vape {
    background: #fff3e0;
    color: #ffcc80;
}

.card-icon-placeholder.edible {
    background: #fce4ec;
    color: #f48fb1;
}

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

.card-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.brand-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
}

.strain-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.strain-badge.sativa {
    background: #fff3e0;
    color: #e65100;
}

.strain-badge.indica {
    background: #ede7f6;
    color: #512da8;
}

.strain-badge.hybrid {
    background: #e8f5e9;
    color: #2e7d32;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
}

.arrow {
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.2s;
    color: #2e7d32;
}

.product-card:hover .arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ========== Pagination ========== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination {
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid #eee;
    display: flex;
    gap: 15px;
    align-items: center;
}

.page-link {
    text-decoration: none;
    font-weight: 600;
    color: #2e7d32;
}

.current {
    color: #999;
}

/* ========== PRODUCT DETAIL PAGE ========== */
.breadcrumbs {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.breadcrumbs a {
    color: #666;
    text-decoration: none;
}

.breadcrumbs .current {
    color: #333;
    font-weight: 600;
}

.separator {
    margin: 0 8px;
    color: #ccc;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .product-layout {
        grid-template-columns: 400px 1fr;
        gap: 3rem;
    }
}

/* --- FIXED DETAIL IMAGE (Bulletproof) --- */
.image-stage {
    width: 100%;
    aspect-ratio: 1 / 1; /* Force Square */
    position: relative; /* Anchor for absolute image */
    overflow: hidden;
    border-radius: 20px;
    background: #f5f5f5;
    border: 1px solid #eee;
    display: block; /* Important: Block, not flex, for absolute kids */
}

/* The Hero Image Itself */
.image-stage .product-hero-img {
    position: absolute; /* Locks it to the edges */
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain; /* Shows the whole product */
    z-index: 1;
}

/* Fallback Icon if no image */
.image-stage .placeholder-icon {
    font-size: 4rem;
    font-weight: 800;
    color: #ccc;
    background: white;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    z-index: 1;
}

/* Strain Tag on top of image */
.image-stage .strain-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

/* --- Info Column --- */
.product-info h1 {
    font-size: 2.5rem;
    margin: 0.5rem 0 1rem;
    line-height: 1.1;
}

.brand-link {
    font-size: 1.1rem;
    color: #2e7d32;
    margin: 0;
}

.specs {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

.action-box {
    background: #f1f8e9;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #c8e6c9;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-text h3 {
    margin: 0 0 5px;
    font-size: 1.1rem;
}

.action-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

.btn-find-deal {
    background: #2e7d32;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
    transition: transform 0.2s;
    white-space: nowrap;
}

.btn-find-deal:hover {
    transform: translateY(-2px);
    background: #1b5e20;
}

.description-box h3 {
    margin-top: 0;
    font-size: 1.25rem;
}

.description-box p {
    line-height: 1.6;
    color: #4b5563;
}

/* ========== MODERN REVIEWS SECTION ========== */
.section-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 4rem 0;
}

.reviews-section {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 4rem;
}


.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.rating-summary {
    text-align: right;
}

.big-score {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1;
}

.total-reviews {
    display: block;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}


.write-review-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.write-review-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}


.star-input-wrapper {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 1rem;
}

.star-input-wrapper input {
    display: none;
}

.star-input-wrapper label {
    font-size: 1.8rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star-input-wrapper label:hover,
.star-input-wrapper label:hover ~ label,
.star-input-wrapper input:checked ~ label {
    color: #fbc02d;
}

.modern-textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.modern-textarea:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.btn-submit {
    background: #333;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.review-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.review-card:last-child {
    border-bottom: none;
}

.review-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.reviewer-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reviewer-meta h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #1a1a1a;
}

.review-date {
    font-size: 0.8rem;
    color: #999;
}

.static-stars {
    color: #fbc02d;
    font-size: 1rem;
    letter-spacing: 2px;
}

.review-body {
    color: #444;
    line-height: 1.6;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.action-btn {
    background: #f1f1f1;
    border: 1px solid #ddd;
    color: #666;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #2e7d32;
}

.action-btn.delete:hover {
    background: #ffebee;
    color: #d32f2f;
    border-color: #d32f2f;
}

.review-body p {
    font-size: 1rem;
    line-height: 1.5;
    color: #444;
    margin: 0 0 15px 0;
}

.review-actions {
    display: flex;
    gap: 12px;
    border-top: 1px solid #fafafa;
    padding-top: 12px;
}

.action-link {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #bbb;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}

.action-link:hover {
    color: #2e7d32;
}

.action-link.delete:hover {
    color: #d32f2f;
}

.review-card.htmx-swapping {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#load-more-btn {
    width: 100%;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    margin-top: 1rem;
    transition: background 0.2s;
}

#load-more-btn:hover {
    background: #f0f0f0;
}


.review-skeleton-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.review-skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-skeleton-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #e0e0e0;
    animation: shimmer 1.5s infinite linear;
}

.review-skeleton-bar {
    height: 14px;
    width: 120px;
    border-radius: 4px;
    background-color: #e0e0e0;
    animation: shimmer 1.5s infinite linear;
}

.review-skeleton-text {
    height: 60px;
    width: 100%;
    border-radius: 8px;
    background-color: #e0e0e0;
    animation: shimmer 1.5s infinite linear;
}

.already-reviewed-msg {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f1f8e9;
    border: 1px solid #c8e6c9;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.already-reviewed-msg .icon-wrap {
    background: #2e7d32;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.already-reviewed-msg p {
    margin: 0;
    color: #1b5e20;
    font-weight: 500;
    font-size: 0.95rem;
}

.already-reviewed-msg .btn-view-review {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #2e7d32;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.already-reviewed-msg .btn-view-review:hover {
    border-bottom-color: #2e7d32;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}