/**
 * RTFM WooCommerce Etsy - Scrolled header style
 * Injected via main.js when user scrolls past 80px
 */

/* =========================================================
   Hero product showcase (replaces banner image)
   ========================================================= */
/* Increase hero height so text is never clipped */
.etsy-hero-inner {
    min-height: 460px;
}
.etsy-hero-products {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 36px 28px;
    background: linear-gradient(135deg, #E8C8A8 0%, #D9B086 100%);
}
.etsy-hero-picks-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(34,34,34,.55);
    margin: 0 0 6px;
}
.etsy-hero-pick {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,.88);
    border-radius: var(--etsy-radius, 8px);
    overflow: hidden;
    text-decoration: none !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: background .2s, box-shadow .2s, transform .2s;
    padding: 10px 14px 10px 10px;
}
.etsy-hero-pick:hover {
    background: rgba(255,255,255,.98);
    box-shadow: 0 4px 16px rgba(0,0,0,.13);
    transform: translateX(3px);
}
.etsy-hero-pick-img {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    background: var(--etsy-bg-warm, #F0E5D3);
}
.etsy-hero-pick-img img,
.etsy-hero-pick-img .woocommerce-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.etsy-hero-pick:hover .etsy-hero-pick-img img {
    transform: scale(1.08);
}
.etsy-hero-pick-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--etsy-orange, #F1641E);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
}
.etsy-hero-pick-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.etsy-hero-pick-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--etsy-text, #222);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.etsy-hero-pick-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--etsy-text-2, #595959);
}
.etsy-hero-pick-price .woocommerce-Price-amount {
    color: var(--etsy-orange, #F1641E);
}
.etsy-hero-picks-cta {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--etsy-text, #222);
    text-decoration: none;
    opacity: 0.65;
    transition: opacity .15s;
}
.etsy-hero-picks-cta:hover { opacity: 1; text-decoration: underline; }
/* Mobile */
@media (max-width: 767px) {
    .etsy-hero-products {
        order: -1;
        padding: 20px 16px;
    }
    .etsy-hero-pick-img { width: 56px; height: 56px; }
    /* Allow name to wrap instead of truncating off-screen */
    .etsy-hero-pick-name {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    /* Prevent cards from overflowing the panel */
    .etsy-hero-pick {
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
    }
    .etsy-hero-pick-info {
        min-width: 0;
        overflow: hidden;
    }
}
#masthead.scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
}

/* Search form focused ring */
.etsy-search-form.focused {
    box-shadow: 0 0 0 4px rgba(241, 100, 30, 0.18);
}

/* Wishlist active state */
.etsy-product-wishlist.active svg {
    fill: #F1641E;
    stroke: #F1641E;
}

/* Responsive trust badges */
@media (max-width: 640px) {
    .etsy-trust-badges > div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Trust & Value Props section */
.etsy-trust-section {
    background: var(--etsy-bg-cream, #FAF6F2);
    border-top: 1px solid var(--etsy-border, #E1E3DF);
    border-bottom: 1px solid var(--etsy-border, #E1E3DF);
}
.etsy-trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    text-align: center;
}
.etsy-trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
}
.etsy-trust-icon {
    font-size: 2.4rem;
    line-height: 1;
}
.etsy-trust-item h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--etsy-text, #222222);
}
.etsy-trust-item p {
    font-size: 0.9rem;
    color: var(--etsy-text-2, #595959);
    margin: 0;
    line-height: 1.5;
}
@media (max-width: 640px) {
    .etsy-trust-badges {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Site-wide banner below header */
.rtfm-site-banner {
    width: 100%;
    line-height: 0;
}
.rtfm-site-banner-img {
    display: block;
    width: 100%;
    height: auto;
}

/* WooteePub shipping notice */
span.wooteepub-shipping-notice {
    display: block;
    background-color: #f8f6f2;
    border: 1px solid #e0d8cc;
    border-left: 4px solid #c9a96e;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 12px 0;
    font-size: 0.95em;
    color: #444;
    line-height: 1.5;
}

/* =========================================================
   Shop page — products grouped by category
   ========================================================= */
.etsy-cat-section {
    padding: 32px 0 16px;
    border-bottom: 1px solid var(--etsy-border, #e8e8e8);
}
.etsy-cat-section:last-of-type {
    border-bottom: none;
}

/* Section header row */
.etsy-cat-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.etsy-cat-section-head-titles {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.etsy-cat-section-thumb {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--etsy-border, #e8e8e8);
}
.etsy-cat-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: var(--etsy-text, #222222);
}
.etsy-cat-section-subtitle {
    font-size: 0.875rem;
    color: var(--etsy-text-2, #595959);
    margin: 2px 0 0;
    flex-basis: 100%;
}

/* "View all →" link (top-right) */
.etsy-cat-view-all {
    white-space: nowrap;
    align-self: center;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Product grid — reuse the homepage grid class */
.etsy-cat-section .products.etsy-products-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* "View all" button at the bottom of each section */
.etsy-cat-section-footer {
    display: flex;
    justify-content: center;
    padding: 20px 0 8px;
}
.etsy-cat-view-all-btn {
    min-width: 220px;
    text-align: center;
}

/* Responsive tweaks */
@media (max-width: 1024px) {
    .etsy-cat-section .products.etsy-products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 768px) {
    .etsy-cat-section .products.etsy-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    .etsy-cat-section-title {
        font-size: 1.15rem;
    }
}
@media (max-width: 480px) {
    .etsy-cat-section .products.etsy-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .etsy-cat-view-all {
        display: none; /* shown only in footer button on mobile */
    }
}
