/* FF C7 Products - v1.6.0 */

:root {
    --ff-c7p-primary: #b08d57;
    --ff-c7p-primary-hover: #96784a;
    --ff-c7p-text-dark: #333;
    --ff-c7p-text-medium: #666;
    --ff-c7p-border: #ddd;
    --ff-c7p-bg-light: #f9f9f9;
    --ff-c7p-white: #fff;
    --ff-c7p-grid-aspect: 1 / 1;
    --ff-c7p-single-aspect: 1 / 1;
}

/* Grid */
.ff-c7p-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 0 0 40px;
}

/* Card */
.ff-c7p-card {
    background: var(--ff-c7p-white);
    border: 1px solid var(--ff-c7p-border);
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.ff-c7p-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.ff-c7p-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.ff-c7p-card-image {
    aspect-ratio: var(--ff-c7p-grid-aspect);
    overflow: hidden;
    background: var(--ff-c7p-bg-light);
}
.ff-c7p-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.ff-c7p-card:hover .ff-c7p-card-image img {
    transform: scale(1.03);
}
.ff-c7p-no-image {
    width: 100%;
    height: 100%;
    background: var(--ff-c7p-bg-light);
}
.ff-c7p-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.ff-c7p-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--ff-c7p-text-dark);
}
.ff-c7p-card-title a {
    text-decoration: none;
    color: inherit;
}
.ff-c7p-card-title a:hover {
    color: var(--ff-c7p-primary);
}
.ff-c7p-card-teaser {
    font-size: 0.875rem;
    color: var(--ff-c7p-text-medium);
    margin: 0 0 10px;
    line-height: 1.5;
    flex: 1;
}
.ff-c7p-card-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ff-c7p-primary);
    margin: 0 0 12px;
}
.ff-c7p-card-price .ff-c7p-price-original,
.ff-c7p-single-price .ff-c7p-price-original {
    text-decoration: line-through;
    color: var(--ff-c7p-text-medium);
    font-weight: 400;
    margin-right: 6px;
}
.ff-c7p-card-price .ff-c7p-price-discounted,
.ff-c7p-single-price .ff-c7p-price-discounted {
    color: var(--ff-c7p-primary);
    font-weight: 700;
    margin-right: 6px;
}
.ff-c7p-card-price .ff-c7p-price-label,
.ff-c7p-single-price .ff-c7p-price-label {
    font-size: 0.8em;
    font-weight: 500;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 1px 6px;
    border-radius: 3px;
    vertical-align: middle;
}
.ff-c7p-card-atc {
    margin-top: auto;
}
.ff-c7p-no-products {
    color: var(--ff-c7p-text-medium);
}

/* Archive wrapper */
.ff-c7p-archive-wrap {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}
.ff-c7p-archive-header {
    margin-bottom: 32px;
}
.ff-c7p-archive-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--ff-c7p-text-dark);
}
.ff-c7p-archive-description {
    font-size: 1rem;
    color: var(--ff-c7p-text-medium);
    line-height: 1.6;
}

/* Card meta fields */
.ff-c7p-card-collection {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ff-c7p-text-medium);
    margin: 0 0 6px;
}
.ff-c7p-card-type {
    font-size: 0.8rem;
    color: var(--ff-c7p-text-medium);
    margin: 0 0 6px;
}
.ff-c7p-card-sku,
.ff-c7p-card-vintage,
.ff-c7p-card-varietal,
.ff-c7p-card-appellation,
.ff-c7p-card-region,
.ff-c7p-card-abv {
    font-size: 0.8rem;
    color: var(--ff-c7p-text-medium);
    margin: 0 0 4px;
}
.ff-c7p-label {
    font-weight: 600;
    color: var(--ff-c7p-text-dark);
}

/* Buttons */
.ff-c7p-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    margin-top: auto;
}
.ff-c7p-btn-select {
    background: var(--ff-c7p-primary);
    color: var(--ff-c7p-white);
    border: none;
}
.ff-c7p-btn-select:hover {
    background: var(--ff-c7p-primary-hover);
    color: var(--ff-c7p-white);
}
.ff-c7p-btn-members {
    background: var(--ff-c7p-primary);
    color: var(--ff-c7p-white);
    border: none;
    display: block;
    text-align: center;
}
.ff-c7p-btn-members:hover {
    background: var(--ff-c7p-primary-hover);
    color: var(--ff-c7p-white);
}
.ff-c7p-members-only {
    display: none;
    margin-top: 8px;
}
.ff-c7p-members-only.ff-c7p-visible {
    display: block;
}
.ff-c7p-atc-members {
    display: none;
}
.ff-c7p-atc-members.ff-c7p-visible {
    display: block;
}
.ff-c7p-members-join {
    font-size: 0.85rem;
    margin: 8px 0 0;
    color: var(--ff-c7p-text-medium);
    text-align: center;
}
.ff-c7p-members-join a {
    color: var(--ff-c7p-primary);
    text-decoration: underline;
}

/* Single product */
.ff-c7p-single-wrap {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}
.ff-c7p-single-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
    margin-bottom: 40px;
}

/* Gallery */
.ff-c7p-single-gallery {
    position: relative;
}
.ff-c7p-gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.ff-c7p-gallery-main {
    display: block;
    border-radius: 4px;
    overflow: hidden;
    background: var(--ff-c7p-bg-light);
}
.ff-c7p-gallery-main img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: var(--ff-c7p-single-aspect);
    cursor: zoom-in;
}
.ff-c7p-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 8px;
}
.ff-c7p-gallery-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    background: var(--ff-c7p-bg-light);
    cursor: pointer;
}
.ff-c7p-gallery-thumb:hover,
.ff-c7p-gallery-thumb.ff-c7p-thumb-active {
    border-color: var(--ff-c7p-primary);
}
.ff-c7p-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Single content */
.ff-c7p-single-content {
    position: sticky;
    top: 30px;
}
.ff-c7p-single-collection {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ff-c7p-text-medium);
    margin: 0 0 8px;
}
.ff-c7p-single-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--ff-c7p-text-dark);
}
.ff-c7p-single-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--ff-c7p-text-medium);
}
.ff-c7p-single-teaser {
    font-size: 1rem;
    margin: 0 0 20px;
    color: var(--ff-c7p-text-medium);
    line-height: 1.5;
}
.ff-c7p-single-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ff-c7p-primary);
    margin: 0 0 20px;
}
.ff-c7p-buy-widget {
    margin-top: 24px;
}
.ff-c7p-unavailable-msg {
    color: #888;
    font-style: italic;
}

/* Content below product */
.ff-c7p-single-description {
    font-size: 0.95rem;
    color: var(--ff-c7p-text-medium);
    line-height: 1.7;
    border-top: 1px solid var(--ff-c7p-border);
    padding-top: 32px;
}
.ff-c7p-single-description p {
    margin: 0 0 1em;
}

/* Responsive */
@media (max-width: 768px) {
    .ff-c7p-single-top {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .ff-c7p-single-content {
        position: static;
    }
    .ff-c7p-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 480px) {
    .ff-c7p-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Custom Add-to-Cart Form ─────────────────────────────────────────────── */
.ff-c7p-atc-form {
    margin-top: 16px;
}
.ff-c7p-variant-select {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 10px;
    border: 1px solid var(--ff-c7p-border, #ddd);
    border-radius: 4px;
    font-size: 0.95rem;
    background: #fff;
    color: inherit;
}
.ff-c7p-atc-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.ff-c7p-qty {
    width: 64px;
    padding: 8px 6px;
    border: 1px solid var(--ff-c7p-border, #ddd);
    border-radius: 4px;
    font-size: 0.95rem;
    text-align: center;
}
.ff-c7p-btn-atc {
    flex: 1;
    cursor: pointer;
}
.ff-c7p-btn-atc:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.ff-c7p-atc-msg {
    margin-top: 8px;
    font-size: 0.875rem;
    min-height: 1.2em;
}
.ff-c7p-atc-msg--success {
    color: #2e7d32;
}
.ff-c7p-atc-msg--error {
    color: #c62828;
}

/* -------------------------------------------------------------------------
   Variant radio swatches
   ------------------------------------------------------------------------- */
.ff-c7p-variant-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ff-c7p-swatch-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.ff-c7p-swatch-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Text-only swatch (no image) */
.ff-c7p-swatch-label:not(.ff-c7p-swatch-has-img) .ff-c7p-swatch-text {
    display: inline-block;
    padding: 6px 14px;
    border: 2px solid var(--ff-c7p-border);
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--ff-c7p-text-dark);
    background: var(--ff-c7p-white);
    transition: border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.ff-c7p-swatch-label:not(.ff-c7p-swatch-has-img):hover .ff-c7p-swatch-text {
    border-color: var(--ff-c7p-primary);
}

.ff-c7p-swatch-label:not(.ff-c7p-swatch-has-img) input[type="radio"]:checked ~ .ff-c7p-swatch-text {
    border-color: var(--ff-c7p-primary);
    background: var(--ff-c7p-primary);
    color: var(--ff-c7p-white);
}

/* Image swatch */
.ff-c7p-swatch-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--ff-c7p-border);
    transition: border-color 0.15s;
    display: block;
}

.ff-c7p-swatch-label.ff-c7p-swatch-has-img:hover .ff-c7p-swatch-img {
    border-color: var(--ff-c7p-primary);
}

.ff-c7p-swatch-label.ff-c7p-swatch-has-img input[type="radio"]:checked ~ .ff-c7p-swatch-img {
    border-color: var(--ff-c7p-primary);
    box-shadow: 0 0 0 2px var(--ff-c7p-primary);
}

.ff-c7p-swatch-label.ff-c7p-swatch-has-img .ff-c7p-swatch-text {
    font-size: 0.75rem;
    margin-top: 4px;
    color: var(--ff-c7p-text-medium);
    text-align: center;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
