/* Product details page */

.product-details-page {background: #f7f6f2; color: #1a1a1a;}
.details-page {min-height: 100vh; padding: 3rem 2rem 5rem; background: #f7f6f2;}
.details-container {width: min(1200px, 100%); margin: 0 auto;}

/* Back link */
.back-link {display: inline-block; margin-bottom: 2.5rem;
    font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 500;
    color: #1a1a1a; text-decoration: none;}
.back-link:hover {text-decoration: underline;}

/* Product hero */
.product-hero {display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: 2.5rem; overflow: hidden; background: #fff; border: 1px solid #dedbd3; border-radius: 1.25rem;}

/* Product image */
.details-image {min-height: 500px; position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 3rem; background: #f1ede3;}
.details-image::before {content: ''; position: absolute;
    width: 220px; height: 220px; top: -70px; right: -60px;
    border-radius: 50%; background: #c9bebe;}
.details-image::after {content: ''; position: absolute;
    width: 180px; height: 180px; bottom: -70px; left: -55px;
    border-radius: 50%; background: #d6cab1;}

.details-product-image {position: relative; z-index: 1;
    width: min(420px, 85%); max-height: 440px; object-fit: contain;
    filter: drop-shadow(0.8rem 0.9rem 0 rgba(37, 38, 34, 0.12));}

.details-placeholder {width: min(330px, 80%); aspect-ratio: 4 / 5;
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fff; border: 3px solid #252622; border-radius: 1.5rem;
    box-shadow: 0.8rem 0.9rem 0 rgba(37, 38, 34, 0.14); transform: rotate(-2deg);}
.details-logo {width: 65%; height: auto; margin-bottom: 1.2rem;}
.details-placeholder span {padding: 0 1rem;
    font-family: 'DM Sans', sans-serif; font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase; text-align: center; color: #5f5f5f;}

/* Product summary */
.product-summary {display: flex; flex-direction: column; justify-content: center; padding: 4rem;}
.product-category {margin-bottom: 1rem;
    font-family: 'DM Sans', sans-serif; font-size: 0.78rem; font-weight: 600;
    letter-spacing: 0.12em; color: #68737c;}
.product-summary h1 {margin: 0 0 1rem;
    font-family: 'Fraunces', Georgia, serif; font-size: clamp(2.4rem, 4vw, 4rem); font-weight: 700;
    line-height: 1; color: #111;}

/* Rating */
.details-rating {display: flex; align-items: center; gap: 0.6rem; margin-bottom: 2rem;}
.stars {color: #e88a00; letter-spacing: 0.1rem; font-size: 1.1rem;}
.review-count {font-family: 'DM Sans', sans-serif; font-size: 0.9rem; color: #7a8290;}

/* Price */
.details-price {margin-bottom: 1.5rem;
    font-family: 'DM Sans', sans-serif; font-size: 1.6rem; font-weight: 600; color: #111;}

/* Availability */
.availability {display: flex; align-items: center; gap: 0.6rem;
    margin-bottom: 2rem; font-family: 'DM Sans', sans-serif; font-size: 0.95rem;}
.availability-dot {width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; background: #4a7c4e;}

/* Purchase controls */
.purchase-section {width: 100%; display: flex; align-items: flex-end; gap: 1.25rem;}
.quantity-section {flex: 1; max-width: 260px;}

.quantity-label {display: block; margin-bottom: 0.5rem;
    font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 500; color: #59616c;}

/* Quantity selector */
.quantity-selector {height: 48px; display: grid;
    grid-template-columns:
        48px
        minmax(70px, 1fr)
        48px;
    overflow: hidden;background: #fff; border: 1px solid #b9b9b5; border-radius: 0.75rem;}
.quantity-btn {border: none; background: #fff;
    font-family: 'DM Sans', sans-serif; font-size: 1.25rem; font-weight: 500;
    color: #1a1a1a; cursor: pointer;
    transition: background 0.15s, color 0.15s;}
.quantity-btn:hover:not(:disabled) {background: #f0eee8;}
.quantity-btn:disabled {color: #b9b9b5; cursor: not-allowed;}
.quantity-value {width: 100%; min-width: 0;
    border: none; border-left: 1px solid #d4d4d0; border-right: 1px solid #d4d4d0; background: #fff;
    font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 500;
    color: #1a1a1a; text-align: center; outline: none; -moz-appearance: textfield;
}
.quantity-value::-webkit-outer-spin-button,
.quantity-value::-webkit-inner-spin-button {margin: 0; -webkit-appearance: none;}

/* Add to cart */
.details-cart {min-width: 170px; height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 2rem; border: none; border-radius: 0.8rem; background: #1a1a1a; color: #fff;
    font-family: 'DM Sans', sans-serif; font-size: 0.95rem; font-weight: 600;
    cursor: pointer;
    transition:
        background 0.15s,
        transform 0.15s;
}
.details-cart:hover {background: #374151; transform: translateY(-1px);}

/* Product information */
.product-information {display: grid;grid-template-columns: 1fr;gap: 1.25rem;}
.info-section {width: 100%;min-width: 0;padding: 2rem 2.25rem;
    background: #fff;border: 1px solid #dedbd3;border-radius: 1rem;}
.info-section h2 {margin: 0 0 1.25rem; padding-bottom: 0.8rem; border-bottom: 1px solid #1a1a1a;
    font-family: 'Fraunces', Georgia, serif; font-size: 1.4rem; font-weight: 600; color: #1a1a1a;
}
.expandable-content {
    font-family: 'DM Sans', sans-serif; font-size: 0.95rem;line-height: 1.7;color: #59616c;
    overflow-wrap: anywhere; word-break: break-word; max-height: 5.2rem; overflow: hidden;
}
.expandable-card.is-expanded .expandable-content {max-height: none;}

.read-more-btn {margin-top: 1rem; padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent;
    font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.read-more-btn:hover {opacity: 0.65;}
.allergen-section {background: #f3eee4;}

/* Product not found */
.not-found {padding: 5rem 1rem; text-align: center;}
.not-found h1 {margin-bottom: 2rem; font-family: 'Fraunces', Georgia, serif;}

/* Tablet */
@media (max-width: 900px) {

    .details-page {
        padding: 2rem 1.5rem 4rem;
    }

    .product-summary {
        padding: 2.5rem;
    }

    .details-image {
        min-height: 420px;
    }

    .purchase-section {
        flex-direction: column;
        align-items: stretch;
    }

    .quantity-section {
        width: 100%;
        max-width: none;
    }

    .details-cart {
        width: 100%;
    }

    .product-information {
        grid-template-columns: 1fr;
    }
}


/* Mobile */
@media (max-width: 700px) {

    .details-page {
        padding: 1.5rem 1rem 3rem;
    }

    .back-link {
        margin-bottom: 1.5rem;
    }

    .product-hero {
        grid-template-columns: 1fr;
    }

    .details-image {
        min-height: 350px;

        padding: 2rem;
    }

    .details-placeholder {
        width: min(250px, 75%);
    }

    .product-summary {
        padding: 2rem 1.5rem;
    }

    .product-summary h1 {
        font-size: 2.4rem;
    }

    .details-rating {
        flex-wrap: wrap;
    }

    .purchase-section {
        flex-direction: column;
        align-items: stretch;

        gap: 1rem;
    }

    .quantity-section {
        width: 100%;
        max-width: none;
    }

    .quantity-selector {
        width: 100%;
    }

    .details-cart {
        width: 100%;
        min-height: 48px;
    }

    .product-information {
        grid-template-columns: 1fr;

        gap: 1rem;
    }

    .info-section {
        padding: 1.5rem;
    }
}


/* Small mobile */
@media (max-width: 420px) {

    .details-page {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .details-image {
        min-height: 300px;

        padding: 1.5rem;
    }

    .details-placeholder {
        width: min(220px, 80%);
    }

    .product-summary {
        padding: 1.5rem 1.25rem;
    }

    .product-summary h1 {
        font-size: 2rem;
    }

    .details-price {
        font-size: 1.4rem;
    }

    .stars {
        font-size: 1rem;
    }

    .review-count {
        font-size: 0.82rem;
    }

    .quantity-selector {
        grid-template-columns:
            48px
            minmax(60px, 1fr)
            48px;
    }
}

.details-subscribe,
.review-product-link {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
}

.details-subscribe {
    padding: 0 1.4rem;
    border: 1.5px solid #58695e;
    background: #58695e;
    color: #fbf9f3;
}

.review-product-link {
    width: fit-content;
    margin-top: 1rem;
    padding: 0 1rem;
    border: 1px solid #b9b9b5;
    color: #58695e;
}

.product-reviews,
.subscription-panel,
.dashboard-hero,
.dashboard-panel {
    padding: 2rem 2.25rem;
    border: 1px solid #dedbd3;
    border-radius: 1rem;
    background: #fff;
}

.product-reviews {
    margin-top: 1.25rem;
}

.reviews-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.reviews-heading h1,
.reviews-heading h2 {
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    line-height: 1;
}

.reviews-heading a,
.dashboard-map-link {
    color: #58695e;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: underline;
}

.reviews-list {
    display: grid;
    gap: 1rem;
}

.review-card,
.review-empty,
.subscription-row,
.dashboard-row {
    padding: 1rem;
    border: 1px solid #e4dfd4;
    background: #fbf9f3;
}

.review-card > div,
.dashboard-row,
.subscription-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.review-card strong,
.dashboard-row strong,
.subscription-row h2 {
    display: block;
    color: #252622;
}

.review-card span,
.dashboard-row span,
.subscription-row p,
.dashboard-empty {
    color: #6c665d;
    font-size: 0.9rem;
    line-height: 1.5;
}

.review-stars,
.community-rating {
    margin: 0.5rem 0;
    color: #70483e;
    letter-spacing: 0;
}

.subscription-panel {
    display: grid;
    gap: 1.5rem;
}

.subscription-panel h1,
.dashboard-hero h1 {
    margin: 0 0 1rem;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2.4rem, 4vw, 4rem);
    line-height: 1;
}

.subscription-form,
.review-form {
    display: grid;
    gap: 1rem;
}

.frequency-options {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    border: 0;
}

.frequency-options legend {
    margin-bottom: 0.75rem;
    font-weight: 800;
}

.frequency-card {
    min-width: 0;
    padding: 1rem;
    display: grid;
    gap: 0.4rem;
    border: 1.5px solid #cfc8bc;
    background: #fbf9f3;
}

.frequency-card:has(input:checked) {
    border-color: #58695e;
    box-shadow: inset 0 0 0 1px #58695e;
}

.frequency-card input {
    width: fit-content;
}

.frequency-card strong {
    font-size: 1.4rem;
}

.frequency-card small,
.recurring-ack span {
    color: #6c665d;
    line-height: 1.45;
}

.recurring-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.recurring-summary > div {
    padding: 1rem;
    background: #f4f0e7;
}

.recurring-summary span,
.recurring-summary strong {
    display: block;
}

.recurring-ack {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.subscription-submit {
    width: fit-content;
}

.subscription-management {
    margin-top: 0;
}

.subscription-actions {
    min-width: 260px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.subscription-actions select,
.subscription-actions button,
.review-form input,
.review-form select,
.review-form textarea {
    min-height: 42px;
    border: 1px solid #b9b9b5;
    background: #fff;
    font: inherit;
}

.subscription-actions button {
    padding: 0 0.8rem;
    background: #252622;
    color: #fff;
    cursor: pointer;
}

.review-form label {
    display: grid;
    gap: 0.4rem;
    font-weight: 800;
}

.review-form input,
.review-form select,
.review-form textarea {
    width: 100%;
    padding: 0.75rem;
}

.dashboard-hero {
    margin-bottom: 1.25rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.dashboard-row-stack {
    display: grid;
}

@media (max-width: 800px) {
    .frequency-options,
    .recurring-summary,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .review-card > div,
    .dashboard-row,
    .subscription-row {
        display: grid;
    }

    .subscription-actions {
        min-width: 0;
        justify-content: flex-start;
    }
}
