/**
 * pages/home.css — Product Grid, Title Block, Category Nav & Purchase Modal
 * Premium white cards, gradient product names, earth-tone design.
 */

/* ═══ Page ═══ */
.page-home { max-width: 1200px; margin: 0 auto; padding: 0 16px 60px; }

/* ═══ Title Block override for home ═══ */
.home-title-block { width: 100%; min-width: unset; }

/* ═══ Category Nav Slot — centered below title ═══ */
.home-nav-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    min-height: 24px;
}

/* ═══ Category Sections ═══ */
.category-section {
    margin-bottom: 48px;
    animation: fadeUp .5s ease both;
}

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

.category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.category-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent, #2D6A4F);
    white-space: nowrap;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

.category-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--accent, #2D6A4F), transparent);
    border-radius: 1px;
}

/* ═══ Product Row ═══ */
.product-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ═══ Product Cards ═══ */
.product-card {
    background: #fff;
    border-radius: 14px;
    border: 2px solid var(--accent, #2D6A4F);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .35s, transform .35s;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.product-card:hover {
    box-shadow: 0 8px 28px rgba(var(--accent-rgb, 45,106,79),.15);
    transform: translateY(-4px);
}

/* Name — gradient color-shifting text */
.product-card-name {
    padding: 18px 16px 10px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-align: center;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--accent, #2D6A4F), #4caf50, #81c784, var(--accent, #2D6A4F));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: name-gradient 6s ease-in-out infinite;
}

@keyframes name-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Image */
.product-card-img-wrap {
    display: block;
    padding: 0 14px;
}

.product-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 10px;
    background: #f8f8f6;
    transition: transform .4s ease;
}
.product-card:hover .product-card-img { transform: scale(1.03); }

.product-card-img-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #f2f0ec, #e8e6e2);
    border-radius: 10px;
}

/* Price — single accent underline */
.product-card-price-wrap {
    padding: 14px 16px 6px;
    text-align: center;
}

.product-card-price {
    font-size: 20px;
    font-weight: 900;
    color: #1a1a1a;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

.product-card-price-old {
    font-size: 13px;
    color: #bbb;
    text-decoration: line-through;
    margin-right: 6px;
}

.product-card-price-line {
    display: block;
    width: 50%;
    height: 2px;
    margin: 8px auto 0;
    border-radius: 1px;
    background: linear-gradient(90deg, var(--accent, #2D6A4F), #81c784);
}

/* Quantity Selector */
.product-card-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 14px 0;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 10px;
    overflow: hidden;
    background: #fafaf8;
}

.qty-btn {
    flex: 0 0 40px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    color: var(--accent, #2D6A4F);
    background: rgba(45,106,79, .05);
    text-decoration: none;
    transition: background .2s, transform .15s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    line-height: 1;
}
.qty-btn svg { width: 16px; height: 16px; }

.qty-btn:hover { background: rgba(45,106,79, .1); }
.qty-btn:active { background: rgba(45,106,79, .18); transform: scale(0.92); }

.qty-input {
    flex: 1;
    height: 38px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    border: none;
    border-left: 1px solid rgba(0,0,0,.06);
    border-right: 1px solid rgba(0,0,0,.06);
    background: #fff;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    -moz-appearance: textfield;
    outline: none;
    cursor: default;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Action buttons — side by side: cart icon (square) + PURCHASE (fill) */
.product-card-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px 16px;
}

.btn-cart {
    flex: 0 0 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 2px solid var(--accent, #2D6A4F);
    background: #fff;
    color: var(--accent, #2D6A4F);
    text-decoration: none;
    transition: all .3s;
    cursor: pointer;
    position: relative;
}
.btn-cart svg { width: 18px; height: 18px; }
.btn-cart::after {
    content: '+';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent, #2D6A4F);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid #fff;
    pointer-events: none;
}
.btn-cart:hover {
    background: rgba(var(--accent-rgb, 45,106,79), .06);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(var(--accent-rgb, 45,106,79),.15);
}

.btn-purchase {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent, #2D6A4F);
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all .3s;
    cursor: pointer;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

.btn-purchase:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb, 45,106,79), .3);
}

/* ═══ Slot Spanning ═══ */
.product-card.slot-1 { grid-column: span 1; }
.product-card.slot-2 { grid-column: span 2; }
.product-card.slot-3 { grid-column: span 3; }

/* ═══ Content Blocks ═══ */
.content-block {
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 200px;
}
.content-block.slot-1 { grid-column: span 1; }
.content-block.slot-2 { grid-column: span 2; }
.content-block.slot-3 { grid-column: span 3; }
.block-title { font-size: 16px; font-weight: 800; letter-spacing: 1px; margin-bottom: 6px; }
.block-body { font-size: 13px; opacity: .9; line-height: 1.6; }
.block-img { max-width: 100%; max-height: 120px; border-radius: 8px; margin-bottom: 10px; }

/* ═══ Featured Card (2-slot) ═══ */
.featured-card { overflow: hidden; }
.featured-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
}
.featured-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg, #f8f9fa);
    padding: 16px;
    overflow: hidden;
}
.featured-img-wrap .product-card-img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    border-radius: 10px;
    transition: transform .4s;
}
.featured-card:hover .featured-img-wrap .product-card-img { transform: scale(1.05); }
.featured-detail {
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.featured-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text, #1a1a1a);
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}
.featured-desc {
    font-size: 13px;
    color: var(--text-muted, #777);
    line-height: 1.55;
    flex: 1;
}
.featured-pricing {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.featured-price-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.featured-price-unit {
    font-size: 11px;
    color: var(--accent, #2D6A4F);
    font-weight: 600;
    letter-spacing: .5px;
}
.featured-detail .product-card-qty { margin: 4px 0 0; }
.featured-detail .product-card-actions { padding: 0; margin-top: 6px; }

/* ═══ Showcase Card (3-slot) ═══ */
.showcase-card { overflow: hidden; }
.showcase-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
}
.showcase-intro {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--accent-rgb, 45,106,79), .04), rgba(var(--accent-rgb, 45,106,79), .01));
    border-right: 2px solid rgba(var(--accent-rgb, 45,106,79), .08);
}
.showcase-pitch-title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--text, #1a1a1a);
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    margin-bottom: 12px;
    line-height: 1.3;
}
.showcase-pitch-body {
    font-size: 13.5px;
    color: var(--text-muted, #666);
    line-height: 1.7;
}
.showcase-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.showcase-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--bg, #f8f9fa);
}
.showcase-img-wrap .product-card-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 10px;
    transition: transform .4s;
}
.showcase-card:hover .showcase-img-wrap .product-card-img { transform: scale(1.05); }
.showcase-details {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}
.showcase-details .featured-pricing {
    margin-top: 4px;
}
.showcase-details .product-card-qty { margin: 6px 0 0; }
.showcase-details .product-card-actions { padding: 0; margin-top: 6px; }

/* ═══ Empty State ═══ */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-text { font-size: 14px; color: #888; font-weight: 600; }

/* ═══ Purchase Modal ═══ */
.purchase-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}
.purchase-modal.open { display: flex; align-items: center; justify-content: center; }

.purchase-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.purchase-modal-box {
    position: relative;
    width: 90%;
    max-width: 420px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    overflow: hidden;
    animation: modal-in .3s cubic-bezier(.4,0,.2,1);
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.purchase-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 12px;
}

.pm-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent, #2D6A4F);
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

.pm-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    color: #999;
    text-decoration: none;
    transition: background .2s;
}
.pm-close:hover { background: rgba(0,0,0,.05); color: #333; }

.purchase-modal-body {
    padding: 0 24px 16px;
}

.pm-detail {
    font-size: 20px;
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

.pm-desc {
    font-size: 13px;
    color: #777;
    line-height: 1.6;
}

.purchase-modal-actions {
    display: flex;
    gap: 10px;
    padding: 0 24px 24px;
}

.pm-btn {
    flex: 1;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all .3s;
    cursor: pointer;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

.pm-btn-cart {
    background: rgba(var(--accent-rgb, 45,106,79), .08);
    color: var(--accent, #2D6A4F);
    border: 1px solid rgba(var(--accent-rgb, 45,106,79), .15);
}
.pm-btn-cart:hover {
    background: rgba(var(--accent-rgb, 45,106,79), .15);
    transform: translateY(-1px);
}

.pm-btn-go {
    background: var(--accent, #2D6A4F);
    color: #fff;
    border: 1px solid var(--accent, #2D6A4F);
}
.pm-btn-go:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb, 45,106,79), .3);
}

/* ═══ Responsive ═══ */
@media (max-width: 1024px) {
    .product-row { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .content-block.slot-3 { grid-column: span 3; }
    .product-card.slot-3 { grid-column: span 3; }
    .product-card.slot-2 { grid-column: span 2; }
}

@media (max-width: 768px) {
    .home-title-row { flex-direction: column; align-items: stretch; gap: 12px; }
    .home-nav-slot { justify-content: flex-start; }
    .product-row { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .product-card.slot-2 { grid-column: span 2; }
    .product-card.slot-3 { grid-column: span 2; }
    .featured-layout { grid-template-columns: 1fr; }
    .showcase-layout { grid-template-columns: 1fr; }
    .showcase-product { grid-template-columns: 1fr; }
    .showcase-intro { padding: 20px; border-right: none; border-bottom: 2px solid rgba(var(--accent-rgb), .08); }
    .product-card-name { font-size: 11px; letter-spacing: 2px; padding: 14px 12px 8px; }
    .product-card-img-wrap { padding: 0 10px; }
    .product-card-price { font-size: 17px; }
    .product-card-price-wrap { padding: 10px 12px 4px; }
    .product-card-qty { margin: 8px 10px 0; }
    .qty-btn {
        flex: 0 0 38px;
        height: 36px;
        font-size: 18px;
        font-weight: 900;
        background: rgba(45,106,79, .08);
        color: #2D6A4F;
        min-width: 38px;
    }
    .qty-input { height: 36px; font-size: 14px; }
    .product-card-actions { padding: 8px 10px 12px; gap: 6px; }
    .btn-cart { flex: 0 0 38px; height: 38px; }
    .btn-cart svg { width: 15px; height: 15px; }
    .btn-purchase { height: 38px; font-size: 10px; letter-spacing: 1.5px; }
    .block-mobile-hidden { display: none !important; }
    .content-block.slot-2, .content-block.slot-3 { grid-column: span 2; }
}

@media (max-width: 480px) {
    .product-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-card.slot-2, .product-card.slot-3 { grid-column: span 2; }
    .product-card-name { font-size: 10px; letter-spacing: 1.5px; padding: 12px 8px 6px; }
    .product-card-price { font-size: 15px; }
    .product-card-qty { margin: 6px 8px 0; border-radius: 8px; }
    .qty-btn {
        flex: 0 0 36px;
        height: 34px;
        font-size: 17px;
        font-weight: 900;
        background: rgba(45,106,79, .1);
        color: #2D6A4F;
        min-width: 36px;
    }
    .qty-input { height: 34px; font-size: 13px; }
    .product-card-actions { gap: 4px; padding: 6px 8px 10px; }
    .btn-cart { flex: 0 0 34px; height: 36px; border-radius: 8px; }
    .btn-purchase { height: 36px; font-size: 9px; letter-spacing: 1px; border-radius: 8px; }
    .content-block.slot-1, .content-block.slot-2, .content-block.slot-3 { grid-column: span 2; }
    .purchase-modal-box { width: 95%; }
}
