/*
Theme Name:   GIC Child Astra
Theme URI:    https://giftideaclub.com
Description:  Child theme for Gift Idea Club – built on Astra
Author:       Gift Idea Club
Template:     astra
Version:      1.0.7
Text Domain:  gic-child-astra
*/

/* ============================================================
   BRAND TOKENS
   #CC1939  – primary red
   #0F172A  – dark navy
   #FFFFFF  – white
   ============================================================ */
:root {
    --gic-red:        #CC1939;
    --gic-dark:       #0F172A;
    --gic-white:      #FFFFFF;
    --gic-red-dk:     #a81230;   /* hover state – site accents */
    --gic-gray:       #f5f5f7;
    --gic-border:     #e5e7eb;
    --gic-text:       #1e293b;
    --gic-muted:      #64748b;
    --gic-green:      #16a34a;   /* Available status */
    --gic-amber:      #d97706;   /* disclaimer border */
    /* Amazon button — yellow bg, black text (matches Amazon brand) */
    --gic-amazon-bg:  #FFA41C;
    --gic-amazon-hvr: #e8920a;
    --gic-amazon-txt: #0F172A;
}

/* ============================================================
   ASTRA OVERRIDES – force full-width on our pages
   Targets Astra's inner content wrapper
   ============================================================ */
.gic-gifts-archive .site-content,
.gic-gifts-archive .ast-container,
.gic-single-gift   .site-content,
.gic-single-gift   .ast-container,
.gic-gift-browser-post .site-content,
.gic-gift-browser-post .ast-container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.gic-gifts-archive #content,
.gic-single-gift   #content,
.gic-gift-browser-post #content {
    width: 100% !important;
    padding: 0 !important;
}

/* Hide Astra's sidebar widgets on our pages */
.gic-gifts-archive   #secondary,
.gic-single-gift     #secondary,
.gic-gift-browser-post #secondary {
    display: none !important;
}

/* Make Astra's primary content col take full width */
.gic-gifts-archive   #primary,
.gic-single-gift     #primary,
.gic-gift-browser-post #primary {
    width: 100% !important;
    padding: 0 !important;
    float: none !important;
}

/* ============================================================
   GIFT ARCHIVE LAYOUT  (/gifts/ and taxonomy pages)
   ============================================================ */
.gic-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    box-sizing: border-box;
}

.gic-main {
    flex: 1 1 0;
    min-width: 0;
}

.gic-sidebar {
    flex: 0 0 270px;
    width: 270px;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
}

@media (max-width: 960px) {
    .gic-layout {
        flex-direction: column;
    }
    .gic-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
}

/* ============================================================
   ARCHIVE HEADER
   ============================================================ */
.gic-archive-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--gic-red);
}

.gic-archive-header h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--gic-dark);
    margin: 0 0 6px;
    line-height: 1.2;
}

.gic-archive-header p {
    color: var(--gic-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* Results bar */
.gic-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.gic-result-count {
    margin: 0;
    font-size: 0.88rem;
    color: var(--gic-muted);
}

.gic-sort-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gic-sort-label {
    font-size: 0.82rem;
    color: var(--gic-muted);
    white-space: nowrap;
}

.gic-sort-select {
    padding: 6px 10px;
    border: 1px solid var(--gic-border);
    border-radius: 6px;
    font-size: 0.82rem;
    background: var(--gic-white);
    color: var(--gic-text);
}

/* ============================================================
   PRODUCT CARDS  (archive + inline [gic] shortcode)
   ============================================================ */
.gic-product-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gic-product-card {
    display: flex;
    gap: 18px;
    background: var(--gic-white);
    border: 1px solid var(--gic-border);
    border-radius: 10px;
    padding: 16px;
    transition: box-shadow 0.18s, border-color 0.18s;
}

.gic-product-card:hover {
    box-shadow: 0 4px 20px rgba(204,25,57,0.08);
    border-color: #d1d5db;
}

/* Number badge */
.gic-card-number {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    background: var(--gic-red);
    color: var(--gic-white);
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.gic-no-numbers .gic-card-number { display: none; }

/* Thumbnail */
.gic-card-image {
    flex: 0 0 120px;
    width: 120px;
}

.gic-card-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--gic-gray);
    display: block;
}

.gic-no-image {
    width: 120px;
    height: 120px;
    background: var(--gic-gray);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 0.75rem;
    text-align: center;
}

/* Card body */
.gic-card-body {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gic-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gic-dark);
    margin: 0;
    line-height: 1.3;
}

.gic-card-title a {
    color: inherit;
    text-decoration: none;
}

.gic-card-title a:hover { color: var(--gic-red); }

.gic-card-description {
    font-size: 0.88rem;
    color: var(--gic-muted);
    margin: 0;
    line-height: 1.55;
}

.gic-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.gic-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gic-green);
}

.gic-card-score {
    font-size: 0.8rem;
    color: var(--gic-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.gic-stars { color: var(--gic-amber); letter-spacing: -1px; }

.gic-card-status {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gic-card-status.available    { background: #dcfce7; color: #15803d; }
.gic-card-status.out_of_stock { background: #fee2e2; color: #dc2626; }

.gic-card-actions { margin-top: auto; padding-top: 8px; }

/* Amazon button — yellow bg, black text — used on product cards */
.gic-btn-amazon {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--gic-amazon-bg);
    color: var(--gic-amazon-txt) !important;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: background 0.15s;
    border: none;
    cursor: pointer;
}

.gic-btn-amazon:hover { background: var(--gic-amazon-hvr); color: var(--gic-amazon-txt) !important; }

.gic-btn-amazon svg {
    width: 15px;
    height: 15px;
    fill: var(--gic-amazon-txt);
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .gic-product-card { flex-wrap: wrap; }
    .gic-card-image { flex: 0 0 90px; width: 90px; }
    .gic-card-image img, .gic-no-image { width: 90px; height: 90px; }
}

/* No results */
.gic-no-results {
    padding: 40px 0;
    text-align: center;
    color: var(--gic-muted);
    font-size: 0.95rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.gic-pagination {
    margin-top: 32px;
    text-align: center;
}

.gic-pagination ul {
    display: inline-flex;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.gic-pagination a.page-numbers,
.gic-pagination span.page-numbers {
    padding: 7px 12px;
    border: 1px solid var(--gic-border);
    border-radius: 5px;
    font-size: 0.88rem;
    color: var(--gic-text);
    text-decoration: none;
    transition: background 0.12s;
    display: inline-block;
}

.gic-pagination .current {
    background: var(--gic-red);
    border-color: var(--gic-red);
    color: var(--gic-white);
}

.gic-pagination a.page-numbers:hover {
    background: #fff0f3;
    border-color: var(--gic-red);
    color: var(--gic-red);
}

/* ============================================================
   FILTER SIDEBAR  (archive + taxonomy pages)
   ============================================================ */
.gic-filter-sidebar {
    background: var(--gic-white);
    border: 1px solid var(--gic-border);
    border-radius: 10px;
    overflow: hidden;
}

.gic-filter-sidebar h3 {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--gic-white);
    background: var(--gic-dark);
    margin: 0;
    padding: 12px 16px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.gic-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 14px;
    background: #fef2f4;
    border-bottom: 1px solid var(--gic-border);
}

.gic-active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--gic-white);
    border: 1px solid var(--gic-red);
    color: var(--gic-red);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.gic-active-filter-tag a {
    color: var(--gic-red);
    text-decoration: none;
    font-weight: 700;
    line-height: 1;
    margin-left: 2px;
}

.gic-filter-form {
    display: flex;
    flex-direction: column;
}

.gic-filter-group { border-bottom: 1px solid var(--gic-border); }
.gic-filter-group:last-of-type { border-bottom: none; }

.gic-filter-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}

.gic-filter-group-toggle:hover { background: var(--gic-gray); }

.gic-filter-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gic-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gic-toggle-icon {
    font-size: 0.65rem;
    color: var(--gic-muted);
    transition: transform 0.2s;
    display: inline-block;
}

.gic-filter-group.collapsed .gic-toggle-icon    { transform: rotate(-90deg); }
.gic-filter-group.collapsed .gic-filter-options { display: none; }

.gic-filter-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 14px 12px;
}

.gic-filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gic-text);
    cursor: pointer;
    line-height: 1.4;
}

.gic-filter-group input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--gic-red);
    flex-shrink: 0;
}

.gic-filter-count {
    margin-left: auto;
    font-size: 0.74rem;
    color: #cbd5e1;
}

.gic-filter-actions {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background: var(--gic-gray);
    border-top: 1px solid var(--gic-border);
}

.gic-btn-apply {
    flex: 1;
    background: var(--gic-red);
    color: var(--gic-white);
    border: none;
    border-radius: 6px;
    padding: 9px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.gic-btn-apply:hover { background: var(--gic-red-dk); }

.gic-btn-reset {
    background: var(--gic-white);
    color: var(--gic-muted);
    border: 1px solid var(--gic-border);
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
}

.gic-btn-reset:hover { background: #f1f5f9; }

/* ============================================================
   INLINE PRODUCT BLOCK  ([gic] shortcode in post content)
   ============================================================ */
.gic-inline-products {
    margin: 32px 0;
    clear: both;
}

.gic-inline-products-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gic-dark);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gic-red);
}

/* ============================================================
   POST TEMPLATE LAYOUT  (Gift Browser Post)
   ============================================================ */
.gic-post-template-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    box-sizing: border-box;
    width: 100%;
}

.gic-post-template-main {
    flex: 1 1 0;
    min-width: 0;
}

/* ── CRITICAL: sidebar must have explicit width and not collapse ── */
.gic-post-template-sidebar {
    flex: 0 0 300px;
    width: 300px;
    min-width: 300px;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gic-border) transparent;
}

@media (max-width: 960px) {
    .gic-post-template-layout { flex-direction: column; }
    .gic-post-template-sidebar {
        width: 100%;
        min-width: 0;
        position: static;
        max-height: none;
    }
}

/* Post content typography */
.gic-post-template-main .entry-header { margin-bottom: 22px; }

.gic-post-template-main .entry-title {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.22;
    color: var(--gic-dark);
    margin: 0 0 8px;
}

.gic-post-template-main .entry-meta {
    font-size: 0.82rem;
    color: var(--gic-muted);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.gic-post-template-main .entry-footer {
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid var(--gic-border);
    font-size: 0.84rem;
    color: var(--gic-muted);
}

   ============================================================ */

/* ── Page wrapper ──────────────────────────────────────────── */
/* ============================================================
   SINGLE GIFT PAGE  —  single-gift.php
   Mobile-first. Pixel-matched to reference screenshot.
   ============================================================ */

/* Page wrapper */
.gic-single-page {
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Scroll anchor — no offset, disclaimer is first thing visible */
#gic-top { scroll-margin-top: 0; }

/* ── DISCLAIMER ─────────────────────────────────────────────
   13px, yellow band, icon + text inline
──────────────────────────────────────────────────────────── */
.gic-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    padding: 10px 12px;
    margin: 10px 10px 0;
    font-size: 13px;
    color: #78350f;
    line-height: 1.5;
    box-sizing: border-box;
}

.gic-disclaimer-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    fill: #d97706;
    margin-top: 2px;
}

.gic-disclaimer p { margin: 0; }

.gic-disclaimer strong { font-weight: 700; }

.gic-disclaimer a {
    color: var(--gic-red);
    font-weight: 400;
    text-decoration: underline;
}

/* ── ARTICLE — mobile: single column ───────────────────────── */
.gic-single-article {
    padding: 0 10px 40px;
}

/* ── IMAGE ─────────────────────────────────────────────────── */
.gic-single-image-wrap {
    width: 100%;
    margin: 12px 0 10px;
    line-height: 0;
    /* no border, no shadow — clean like screenshot */
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.gic-single-img {
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: contain;        /* full product — no crop, no blur */
    object-position: center;
    display: block;
    background: #fff;
}

/* ── RIGHT COLUMN — mobile: display:contents (children flow normally) */
.gic-single-right {
    display: contents;
}

/* ── TITLE — 25px bold, tight line-height ───────────────────── */
.gic-single-title {
    font-size: 25px;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
    margin: 8px 0 10px;
    font-family: inherit;
}

/* ── META ROWS: Product ID / Status / Price ─────────────────── */
.gic-single-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.gic-meta-line {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 14px;
    line-height: 1.5;
}

.gic-meta-label {
    color: #111;
    font-weight: 400;
    flex-shrink: 0;
}

.gic-meta-value {
    color: #333;
    font-weight: 400;
}

/* Price — red + bold, matches screenshot */
.gic-meta-price {
    color: var(--gic-red) !important;
    font-weight: 700 !important;
}

/* ── AMAZON BUTTON — yellow bg, black text, full-width ─────── */
.gic-single-cta {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    background: var(--gic-amazon-bg);          /* #FFA41C */
    color: var(--gic-amazon-txt) !important;   /* #0F172A */
    font-size: 15px;
    font-weight: 700;
    padding: 13px 20px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: background 0.15s;
    margin-bottom: 16px;
    letter-spacing: 0.01em;
    font-family: inherit;
}

.gic-single-cta:hover,
.gic-single-cta:focus {
    background: var(--gic-amazon-hvr);
    color: var(--gic-amazon-txt) !important;
    text-decoration: none !important;
}

/* ── POST CONTENT ───────────────────────────────────────────── */
.gic-single-content {
    font-size: 14px;
    line-height: 1.75;
    color: #333;
    margin-bottom: 16px;
}

.gic-single-content p     { margin: 0 0 12px; }
.gic-single-content p:last-child { margin-bottom: 0; }
.gic-single-content h2    { font-size: 17px; font-weight: 700; margin: 20px 0 8px; color: #111; }
.gic-single-content h3    { font-size: 15px; font-weight: 700; margin: 16px 0 6px; color: #111; }
.gic-single-content a     { color: var(--gic-red); text-decoration: underline; }
.gic-single-content strong { font-weight: 700; }
.gic-single-content ul,
.gic-single-content ol    { margin: 0 0 12px 18px; }
.gic-single-content li    { margin-bottom: 4px; }

/* ── TAXONOMY TERMS — horizontal flex wrap, plain text ─────── */
.gic-single-terms {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.gic-plain-term {
    font-size: 12px;
    color: #64748b;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.12s;
    white-space: nowrap;
    line-height: 1.6;
}

.gic-plain-term:hover {
    color: var(--gic-red);
    text-decoration: underline;
}

/* Separator dots between terms */
.gic-plain-term:not(:last-child)::after {
    content: '·';
    margin-left: 8px;
    color: #cbd5e1;
}

/* ============================================================
   DESKTOP  ≥ 768px — 2-column: image left | content right
   ============================================================ */
@media (min-width: 768px) {

    .gic-single-page {
        padding: 0 0 60px;
    }

    .gic-disclaimer {
        margin: 20px 0;
        font-size: 13px;
    }

    /* 2-column grid */
    .gic-single-article {
        display: grid;
        grid-template-columns: 300px 1fr;
        column-gap: 36px;
        align-items: start;
        padding: 0;
    }

    /* Image: left column, sticky */
    .gic-single-image-wrap {
        grid-column: 1;
        grid-row: 1;
        margin: 0;
        position: sticky;
        top: 24px;
        align-self: start;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
    }

    .gic-single-img {
        max-height: 300px;
    }

    /* Right column: block layout */
    .gic-single-right {
        display: flex;
        flex-direction: column;
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        padding-top: 0;
    }

    .gic-single-title {
        font-size: 26px;
        margin-top: 0;
    }

    /* Button: auto-width on desktop */
    .gic-single-cta {
        display: inline-block;
        width: auto;
        min-width: 200px;
        font-size: 15px;
    }

    .gic-single-content {
        font-size: 14px;
    }

    .gic-single-terms {
        margin-top: 20px;
        padding-top: 16px;
    }
}

/* ============================================================
   TABLET  540–767px
   ============================================================ */
@media (min-width: 540px) and (max-width: 767px) {

    .gic-single-article {
        padding: 0 16px 40px;
    }

    .gic-disclaimer {
        margin: 12px 16px 0;
    }

    .gic-single-img {
        max-height: 400px;
    }

    .gic-single-title {
        font-size: 25px;
    }
}
