/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.8rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    border: none;
    border-radius: 0;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn--primary:hover {
    background: var(--color-primary-light);
}

.btn--outline {
    background: transparent;
    color: var(--color-black);
    border: 1px solid var(--color-black);
}

.btn--outline:hover {
    background: var(--color-black);
    color: var(--color-white);
}

.btn--sm {
    padding: 0.4rem 1.2rem;
    font-size: 0.75rem;
}

/* === Product Card === */
.product-card {
    display: flex;
    flex-direction: column;
}

.product-card__image {
    position: relative;
    display: block;
    background: #e9e9e9;
}

.product-card__image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #e9e9e9;
}

.product-card__wishlist {
    position: absolute;
    top: 35px;
    left: 35px;
    z-index: 2;
}

/* YITH v4 block markup */
.product-card__wishlist .yith-add-to-wishlist-button-block {
    margin: 0;
    padding: 0;
}

.product-card__wishlist .yith-wcwl-add-to-wishlist-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 25px;
    padding: 0;
    background: none;
    border: none;
    color: #142809;
    cursor: pointer;
    transition: color 0.15s;
}

.product-card__wishlist .yith-wcwl-add-to-wishlist-button:hover {
    color: #53953b;
}

.product-card__wishlist .yith-wcwl-icon-svg {
    width: 22px;
    height: 20px;
}

.product-card__wishlist .yith-wcwl-add-to-wishlist-button__label {
    display: none;
}

/* Legacy YITH markup fallback */
.product-card__wishlist .yith-wcwl-add-to-wishlist {
    margin: 0;
    padding: 0;
}

.product-card__wishlist .yith-wcwl-add-to-wishlist .yith-wcwl-add-button a,
.product-card__wishlist .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistaddedbrowse a,
.product-card__wishlist .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistexistsbrowse a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 25px;
    padding: 0;
    background: none;
    border: none;
    color: #142809;
    cursor: pointer;
    transition: color 0.15s;
    font-size: 0;
}

.product-card__wishlist .yith-wcwl-add-to-wishlist a:hover {
    color: #53953b;
}

.product-card__wishlist .yith-wcwl-add-to-wishlist a .yith-wcwl-icon {
    font-size: 20px;
}

.product-card__wishlist .yith-wcwl-add-to-wishlist .feedback,
.product-card__wishlist .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistaddedbrowse span,
.product-card__wishlist .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistexistsbrowse span {
    display: none;
}

/* Keep static SVG fallback styled the same */
.product-card__wishlist > svg {
    display: block;
    width: 22px;
    height: 20px;
    color: #142809;
    cursor: pointer;
    transition: color 0.15s;
}

.product-card__wishlist > svg:hover {
    color: #53953b;
}

.product-card__info {
    padding-top: var(--spacing-sm);
}

.product-card__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.3;
    text-transform: uppercase;
    min-height: 2.6em;
}

.product-card__title a {
    color: var(--color-black);
}

.product-card__variant {
    display: block;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 300;
    color: #6f6f6f;
    margin-top: 0.25rem;
    line-height: 1.4;
    min-height: 1.4em;
}

.product-card__price {
    display: block;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    color: #101010;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* === Product Grid === */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px; /* Figma: tight 6px gap between cards */
}

.product-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.product-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

/* === Category Card === */
.category-card {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.category-card__image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--color-off-white);
    margin-bottom: var(--spacing-sm);
}

.category-card__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: var(--spacing-xs);
}

.category-card__description {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1rem;
    color: #101010;
    line-height: 1.4;
    margin-bottom: var(--spacing-sm);
    min-height: 2.8em;
}

/* === Story Card === */
.story-card {
    display: flex;
    flex-direction: column;
}

.story-card__image img {
    width: 100%;
    aspect-ratio: 1; /* Figma: 341x341 square images */
    object-fit: cover;
    margin-bottom: var(--spacing-sm);
}

.story-card__title {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.4;
    color: var(--color-black);
    margin-bottom: var(--spacing-sm);
}

.story-card .btn--outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 52px;
    padding: 0;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    border: 1px solid #142809;
    box-shadow: 6px 6px 6px 0 rgba(123, 178, 60, 0.5);
    text-align: center;
}

/* === Stories Section === */
.stories-section {
    padding: 96px 0px;
}

.stories-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 56px;
    align-items: start;
}

.stories-header {
    padding-top: 0;
}

.stories-label {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.4;
    color: var(--color-black);
    display: block;
    margin-bottom: 56px;
}

.stories-title {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 1.875rem;
    line-height: 1.6;
    color: var(--color-black);
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
}

/* === Recently Viewed === */
.recently-viewed-section {
    padding: 96px 0px;
}

.recently-viewed-section .product-grid {
    gap: 6px;
}

.recently-viewed-section .product-card__image img {
    object-fit: contain;
}

.recently-viewed-section .section-title {
    font-family: var(--font-heading);
    font-size: 1.875rem;
    font-weight: 300;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 72px;
    text-transform: uppercase;
    color: var(--color-black);
}

/* === Newsletter CTA === */
.newsletter-cta {
    margin-top: var(--spacing-md);
}

/* === Section Title (shared) === */
.section-title {
    font-family: var(--font-heading);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

/* === Responsive === */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stories-layout {
        grid-template-columns: 1fr;
    }

    .stories-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================
   NEWSLETTER + JOIN CLAPLEY'S FAMILY
   (moved from home.css so non-home pages can render the form)
   ============================================================= */
.newsletter-heading {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 1.875rem;
    line-height: 1.6;
    color: #142809;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
}

.newsletter-description {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1rem;
    color: #101010;
    line-height: 1.4;
    margin-bottom: var(--spacing-md);
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.newsletter-input-group {
    position: relative;
    display: flex;
}

.newsletter-input-group--full {
    width: 100%;
}

.newsletter-name-row {
    display: flex;
    gap: var(--spacing-sm);
}

.newsletter-input-group--half {
    flex: 1;
}

.newsletter-input {
    width: 100%;
    padding: 0.875rem 0.625rem;
    border: 1px solid #0d520f;
    background: var(--color-white);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.875rem;
    color: #101010;
    box-shadow: 6px 6px 6px #7bb23c;
    outline: none;
    transition: border-color 0.2s;
}

.newsletter-input:focus {
    border-color: #142809;
}

.newsletter-input::placeholder {
    color: #6f6f6f;
    font-size: 0.75rem;
}

.newsletter-privacy {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.newsletter-privacy__checkbox {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid #0d520f;
    background: var(--color-white);
    box-shadow: 6px 6px 6px #7bb23c;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
}

.newsletter-privacy__checkbox:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.125rem;
    color: #142809;
}

.newsletter-privacy__text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--color-black);
    line-height: 1.4;
    padding-top: 0.5rem;
}

.newsletter-privacy__link {
    text-decoration: underline;
    color: inherit;
}

.newsletter-submit-btn {
    display: block;
    margin-inline: auto;
    width: 166px;
    height: 48px;
    background: #142809;
    color: var(--color-white);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    text-transform: capitalize;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1.4;
}

.newsletter-submit-btn:hover {
    background: #0d520f;
}

.join-family {
    padding: 5rem 0 10rem;
    background: #fff;
}
.join-family__grid {
    display: grid;
    grid-template-columns: 684px 387px;
    gap: 98px;
    align-items: center;
    justify-content: center;
}
.join-family__image {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f5f5;
}
.join-family__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.join-family__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}
.join-family__logo {
    width: 120px;
    margin-bottom: 0.5rem;
}
.join-family__logo img {
    width: 100%;
    height: auto;
    display: block;
}
.newsletter-success {
    font-size: 18px;
    color: var(--color-clapley-pine, #0D520F);
    margin: 1rem 0;
    font-weight: 500;
}

@media (max-width: 1023px) {
    .newsletter-name-row {
        flex-direction: column;
    }
    .join-family__grid { grid-template-columns: 1fr; gap: 2rem; max-width: 500px; margin: 0 auto; }
    .join-family__image { max-height: 400px; }
    .join-family__image img { object-position: center; }
}
@media (max-width: 767px) {
    .join-family { padding: 2.5rem 0; }
}
