/**
 * Big V Feeds — Product Database Styles
 *
 * Base styles for the product archive grid, filter bar, product cards,
 * and single product layout. Override in your theme as needed.
 */

/* ── Variables ── */
:root {
    --bigv-red:        #FB0D1B;
    --bigv-dark:       #1a1a1a;
    --bigv-gray:       #f5f5f5;
    --bigv-gray-mid:   #ddd;
    --bigv-white:      #fff;
    --bigv-font:       system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bigv-radius:     6px;
    --bigv-shadow:     0 2px 8px rgba(0,0,0,.08);
}

/* ================================================================== */
/*  Breadcrumbs                                                        */
/* ================================================================== */
.bigv-breadcrumbs {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1rem .5rem;
    font-family: var(--bigv-font);
    font-size: .8rem;
    color: #999;
}

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

.bigv-breadcrumbs a:hover {
    color: var(--bigv-red);
    text-decoration: underline;
}

.bigv-breadcrumbs__sep {
    margin: 0 .35rem;
    color: #ccc;
}

.bigv-breadcrumbs__current {
    color: var(--bigv-dark);
    font-weight: 600;
}

.bigv-single-product .bigv-breadcrumbs {
    padding: 0 0 1.5rem;
}

/* ── Archive title & description ── */
.bigv-archive-title {
    max-width: 1280px;
    margin: 0 auto .5rem;
    padding: 0 1rem;
    font-family: var(--bigv-font);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--bigv-dark);
}

.bigv-archive-desc {
    max-width: 1280px;
    margin: 0 auto 1rem;
    padding: 0 1rem;
    font-size: .925rem;
    color: #555;
}

/* ================================================================== */
/*  ARCHIVE — Filter Bar                                               */
/* ================================================================== */
.bigv-filter-bar {
    background: var(--bigv-white);
    border-bottom: 1px solid var(--bigv-gray-mid);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.bigv-filter-bar__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    align-items: flex-end;
}

.bigv-filter-group {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.bigv-filter-group label {
    font-family: var(--bigv-font);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #666;
}

.bigv-filter-group input,
.bigv-filter-group select {
    font-family: var(--bigv-font);
    font-size: .875rem;
    padding: .5rem .75rem;
    border: 1px solid var(--bigv-gray-mid);
    border-radius: var(--bigv-radius);
    background: var(--bigv-white);
}

.bigv-filter-group input:focus,
.bigv-filter-group select:focus {
    outline: none;
    border-color: var(--bigv-red);
    box-shadow: 0 0 0 2px rgba(200, 16, 46, .15);
}

.bigv-filter-group--checkbox {
    justify-content: flex-end;
}

.bigv-filter-group--checkbox label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .875rem;
    text-transform: none;
    cursor: pointer;
}

/* ================================================================== */
/*  ARCHIVE — Product Grid                                             */
/* ================================================================== */
.bigv-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
    opacity: 0;
    transition: opacity .3s ease;
}

body.bigv-products-ready .bigv-product-grid {
    opacity: 1;
}

/* Loading state shown until the first feed images settle */
.bigv-products-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 4rem 1rem;
    color: #666;
    font-size: .95rem;
}

.bigv-products-loading .bigv-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e5e5;
    border-top-color: var(--bigv-red);
    border-radius: 50%;
    animation: bigv-spin .8s linear infinite;
}

@keyframes bigv-spin {
    to { transform: rotate(360deg); }
}

body.bigv-products-ready .bigv-products-loading {
    display: none;
}

/* ================================================================== */
/*  Product Card                                                       */
/* ================================================================== */
.bigv-product-card {
    background: var(--bigv-white);
    border-radius: var(--bigv-radius);
    box-shadow: var(--bigv-shadow);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.bigv-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.bigv-product-card[data-hidden="true"] {
    display: none;
}

.bigv-product-card__link,
.bigv-product-card__link:hover,
.bigv-product-card__link:focus,
.bigv-product-card a.bigv-product-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Product photo inside cards — scoped overrides of .bigv-product-photo */
.bigv-product-card .bigv-product-photo {
    aspect-ratio: 3 / 4;
    min-height: 0;
}
/*
.bigv-product-card .bigv-product-photo__bag {
    padding: .5rem .75rem 0;
}
*/
.bigv-product-card .bigv-product-photo__bag img {
    max-height: 90%;
}


.bigv-product-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bigv-gray);
    color: #999;
    font-size: 1.5rem;
    font-weight: 700;
}

.bigv-product-card__info {
    padding: .75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.bigv-product-card__id {
    font-family: var(--bigv-font);
    font-size: .7rem;
    font-weight: 700;
    color: var(--bigv-red);
    letter-spacing: .05em;
}

.bigv-product-card__title {
    font-family: var(--bigv-font);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.bigv-product-card__weight {
    font-size: .75rem;
    color: #666;
    font-weight: 600;
}

.bigv-product-card__meds {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-top: .25rem;
}

/* ── Badges ── */
.bigv-badge {
    display: inline-block;
    font-family: var(--bigv-font);
    font-size: .65rem;
    font-weight: 600;
    padding: .15rem .4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.bigv-badge--med {
    background: #fff3cd;
    color: #856404;
}

/* ================================================================== */
/*  SINGLE PRODUCT                                                     */
/* ================================================================== */
.bigv-single-product {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.bigv-single-product__header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .bigv-single-product__header {
        grid-template-columns: 1fr;
    }
}

/* ── 2-in-1 Product Photo (single) ── */
.bigv-product-photo {
    position: relative;
    border-radius: var(--bigv-radius);
    overflow: hidden;
    background: var(--bigv-gray);
    min-height: 380px;
}

/* Feed photo: anchored to the bottom, fully visible */
.bigv-product-photo__feed {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-height: 70%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bigv-product-photo__feed img {
    width: 150%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--bigv-radius);
    margin-bottom: -50%;
}

/* Bag photo: positioned so its bottom sits ~30% from top of feed */
.bigv-product-photo__bag {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem 2rem 0;
}

.bigv-product-photo__bag img {
    max-width: 95%;
    max-height: 340px;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,.22));
}

/* When only one image, let it fill naturally */
.bigv-product-photo.has-one {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bigv-product-photo.has-one .bigv-product-photo__feed {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-height: none;
    padding: 1.5rem;
}

.bigv-product-photo.has-one .bigv-product-photo__bag {
    padding: 1.5rem;
}

.bigv-product-photo.has-one .bigv-product-photo__bag img {
    max-width: 100%;
    max-height: 400px;
}

/* Hover: fade out bag, zoom feed to fill frame */
.bigv-product-photo.has-both .bigv-product-photo__bag {
    transition: opacity .4s ease;
}
.bigv-product-photo.has-both .bigv-product-photo__feed img {
    transition: transform .5s ease, margin .5s ease;
}
.bigv-product-photo.has-both:hover .bigv-product-photo__bag {
    opacity: 0;
}
.bigv-product-photo.has-both:hover .bigv-product-photo__feed img {
    transform: scale(1.5);
    margin-bottom: 0;
}

/* ── Hero Info ── */
.bigv-single-product__hero-info {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    justify-content: center;
}

.bigv-single-product__id {
    font-size: .75rem;
    font-weight: 700;
    color: var(--bigv-red);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.bigv-single-product__title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.15;
    color: var(--bigv-dark);
}

.bigv-single-product__category {
    display: inline-block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--bigv-white);
    background: var(--bigv-red);
    padding: .2rem .6rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .04em;
    align-self: flex-start;
}

.bigv-single-product__family {
    font-size: .9rem;
    color: #555;
}

.bigv-single-product__weight {
    font-size: .9rem;
    color: #555;
    font-weight: 600;
}

.bigv-single-product__family em {
    font-style: italic;
    color: #888;
}

.bigv-single-product__meds {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .25rem;
}

/* ── Buttons ── */
.bigv-btn {
    display: inline-block;
    padding: .6rem 1.2rem;
    border-radius: var(--bigv-radius);
    font-family: var(--bigv-font);
    font-weight: 600;
    font-size: .875rem;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    border: 2px solid transparent;
}

.bigv-btn--primary {
    background: var(--bigv-red);
    color: var(--bigv-white) !important;
}

.bigv-btn--primary:hover {
    background: #d90a17;
}

.bigv-btn--outline {
    background: transparent;
    color: var(--bigv-dark);
    border-color: var(--bigv-gray-mid);
}

.bigv-btn--outline:hover {
    border-color: var(--bigv-red);
    color: var(--bigv-red);
}

.bigv-btn--pdf {
    background: var(--bigv-red);
    color: var(--bigv-white) !important;
    align-self: flex-start;
}

.bigv-btn--pdf:hover {
    background: #d90a17;
}

.bigv-single-product__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.bigv-single-product__tag-link {
    font-size: .8rem;
    color: var(--bigv-red);
    text-decoration: none;
    font-style: italic;
    margin-top: .25rem;
}

.bigv-single-product__tag-link:hover {
    text-decoration: underline;
}

/* ── Sections ── */
.bigv-single-product__section {
    margin-bottom: 2.5rem;
}

.bigv-single-product__section h2 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--bigv-dark);
    border-bottom: 3px solid var(--bigv-red);
    padding-bottom: .5rem;
    margin-bottom: 1rem;
}

.bigv-single-product__section p {
    font-size: .925rem;
    line-height: 1.65;
    color: #444;
}

/* ── Guaranteed Analysis table ── */
.bigv-ga__table {
    width: 100%;
    border-collapse: collapse;
}

.bigv-ga__table tr:nth-child(even) {
    background: var(--bigv-gray);
}

.bigv-ga__table th,
.bigv-ga__table td {
    padding: .6rem .85rem;
    text-align: left;
    font-size: .9rem;
    border-bottom: 1px solid #eee;
}

.bigv-ga__table th {
    font-weight: 600;
    width: 55%;
    color: #333;
}

.bigv-ga__table td {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 600;
    color: var(--bigv-dark);
}


/* ── Product Family grid ── */
.bigv-family__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
}

.bigv-family__item {
    display: flex;
    flex-direction: column;
    padding: .75rem;
    background: var(--bigv-gray);
    border-radius: var(--bigv-radius);
    text-decoration: none;
    color: inherit;
    transition: background .15s ease;
}

.bigv-family__item:hover {
    background: #e8e8e8;
}

.bigv-family__item-id {
    font-size: .7rem;
    font-weight: 700;
    color: var(--bigv-red);
}

.bigv-family__item-name {
    font-size: .8rem;
    font-weight: 600;
}

.bigv-family__item-variant {
    font-size: .7rem;
    color: #888;
    font-style: italic;
}

/* ── Footer ── */
.bigv-single-product__footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    color: #999;
}

/* ── Page content (Gutenberg) tagline ── */
.bigv-single-product__tagline {
    color: #BF9667;
    text-transform: none;
    font-weight: normal;
    font-family: "zilla", serif;
    font-size: 1.5em;
    display: block;
    padding-top: 0.35em;
}

/* ── No results ── */
.bigv-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #999;
}

/* ── Print ── */
@media print {
    #site-header,
    #mobile_menu,
    #site-footer,
    .bigv-single-product__actions,
    .bigv-single-product__tag-link,
    .bigv-filter-bar {
        display: none !important;
    }
}
