/**
 * ADF Product Display Styles
 * Matches Andrew Dominic Furniture design spec
 */

/* ==========================================================================
   Fonts — Sohne (self-hosted, files in assets/fonts/)
   Buch = 400 (body), Kraftig = 500 (smaller titles), Halbfett = 600 (titles)
   ========================================================================== */
@font-face {
    font-family: 'Sohne';
    src: url('../fonts/soehne-web-buch.eot');
    src: url('../fonts/soehne-web-buch.eot?#iefix') format('embedded-opentype'),
         url('../fonts/soehne-web-buch.woff2') format('woff2'),
         url('../fonts/soehne-web-buch.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/soehne-web-kraftig.eot');
    src: url('../fonts/soehne-web-kraftig.eot?#iefix') format('embedded-opentype'),
         url('../fonts/soehne-web-kraftig.woff2') format('woff2'),
         url('../fonts/soehne-web-kraftig.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sohne';
    src: url('../fonts/soehne-web-halbfett.eot');
    src: url('../fonts/soehne-web-halbfett.eot?#iefix') format('embedded-opentype'),
         url('../fonts/soehne-web-halbfett.woff2') format('woff2'),
         url('../fonts/soehne-web-halbfett.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --adf-bg: #e8e7e6;
    --adf-bg-light: #fafaf9;
    --adf-text-primary: #1a1a1a;
    --adf-text-secondary: #1a1a1a; /* was #6b6b6b, body copy now black to match main site */
    --adf-text-muted: #8a8a8a;
    --adf-accent: #bbaba2;
    --adf-accent-hover: #a99a91;
    --adf-border: #e5e5e5;
    --adf-border-dark: #bbaba2;
    --adf-button-dark: #2d2d2d;
    --adf-button-dark-hover: #bbaba2;
    --adf-white: #ffffff;
    --adf-font: 'Sohne', -apple-system, BlinkMacSystemFont, sans-serif;
    --adf-transition: 0.25s ease;

    /* Typography — tweak these to match the main site */
    --adf-title-size: 24px;
    --adf-title-weight: 600; /* Sohne Halbfett, heavier to match main site */
    --adf-body-size: 15px;   /* body copy, up from 14px to match main site */
    --adf-label-size: 14px;  /* "Select ..." step labels */
}

/* ==========================================================================
   Main Container
   ========================================================================== */
.adf-product-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: var(--adf-font);
    color: var(--adf-text-primary);
    line-height: 1.6;
    background-color: var(--adf-bg);
}

.adf-product-display *,
.adf-product-display *::before,
.adf-product-display *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Gallery Column
   ========================================================================== */
.adf-product-gallery {
    align-self: start;
}

.adf-main-image {
    width: 100%;
    margin-bottom: 16px;
    overflow: hidden;
    background-color: var(--adf-bg-light);
}

.adf-main-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: opacity var(--adf-transition);
}

/* Gallery Images (stacked below main image) */
.adf-gallery-images {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.adf-gallery-image {
    width: 100%;
    overflow: hidden;
    background-color: var(--adf-bg-light);
}

.adf-gallery-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ==========================================================================
   Product Info Column
   ========================================================================== */
.adf-product-info {
    position: sticky;
    top: 40px;
    align-self: start;
    padding-top: 20px;
}

/* Title — Sohne Halbfett (brand font consistency pass) */
.adf-product-title {
    font-size: var(--adf-title-size);
    font-weight: var(--adf-title-weight);
    letter-spacing: -0.02em;
    margin: 0 0 16px 0;
    color: var(--adf-text-primary);
}

/* Short Description */
.adf-product-short-desc {
    font-size: var(--adf-body-size);
    color: var(--adf-text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
}

.adf-product-short-desc p {
    margin: 0;
}

/* Price */
.adf-product-price {
    font-size: 22px;
    font-weight: 400;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--adf-text-primary);
    color: var(--adf-text-primary);
}

/* Ensure WooCommerce price elements maintain consistent styling */
.adf-product-price .price,
.adf-product-price .woocommerce-Price-amount,
.adf-product-price .amount,
.adf-product-price bdi {
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
}

.adf-product-price del {
    color: var(--adf-text-muted);
    font-size: 18px;
    margin-right: 8px;
}

.adf-product-price del .woocommerce-Price-amount,
.adf-product-price del .amount,
.adf-product-price del bdi {
    font-size: 18px !important;
    color: var(--adf-text-muted) !important;
}

.adf-product-price ins {
    text-decoration: none;
}

.adf-product-price ins .woocommerce-Price-amount,
.adf-product-price ins .amount,
.adf-product-price ins bdi {
    font-size: 22px !important;
    font-weight: 400 !important;
    color: var(--adf-text-primary) !important;
}

.adf-price-vat {
    font-size: 14px;
    font-weight: 400;
    color: var(--adf-text-secondary);
    margin-left: 8px;
}

/* ==========================================================================
   Variation Form
   ========================================================================== */
.adf-variations-form,
.adf-simple-form {
    margin-bottom: 24px;
}

/* Attribute Groups */
.adf-attribute-group {
    margin-bottom: 28px;
}

.adf-attribute-label {
    display: block;
    font-size: var(--adf-label-size);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--adf-text-primary);
    margin-bottom: 12px;
}

.adf-label-selected {
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Size Buttons */
.adf-attribute-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.adf-option-button {
    width: 100%;
    padding: 14px 20px;
    font-family: var(--adf-font);
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    background-color: transparent;
    border: 1px solid #bbaba2;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--adf-transition);
    color: var(--adf-text-primary);
}

.adf-option-button:hover {
    background-color: #bbaba2;
    border-color: #bbaba2;
    color: var(--adf-white);
}

.adf-option-button.selected {
    background-color: #bbaba2;
    border-color: #bbaba2;
    color: var(--adf-white);
}

.adf-option-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Swatches */
.adf-attribute-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.adf-swatch-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.adf-swatch-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.adf-swatch {
    width: 52px;
    height: 52px;
    border-radius: 4px;
    border: 2px solid transparent;
    overflow: hidden;
    transition: border-color var(--adf-transition);
    background-color: var(--adf-border);
}

.adf-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.adf-swatch-option:hover .adf-swatch {
    border-color: var(--adf-border-dark);
}

.adf-swatch-option.selected .adf-swatch,
.adf-swatch-option input:checked + .adf-swatch {
    border-color: var(--adf-text-primary);
}

.adf-swatch-label {
    font-size: 11px;
    text-transform: none;
    color: var(--adf-text-secondary);
    margin-top: 6px;
    text-align: center;
    max-width: 60px;
    line-height: 1.3;
}

/* Radio indicator for swatches */
.adf-swatch-option::before {
    content: '';
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--adf-border-dark);
    background-color: var(--adf-white);
    transition: all var(--adf-transition);
}

.adf-swatch-option.selected::before,
.adf-swatch-option input:checked ~ .adf-swatch-label::before {
    background-color: var(--adf-text-primary);
    border-color: var(--adf-text-primary);
}

/* Select Dropdowns */
.adf-attribute-select {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--adf-font);
    font-size: 14px;
    border: 1px solid var(--adf-border-dark);
    border-radius: 4px;
    background-color: var(--adf-white);
    color: var(--adf-text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b6b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.adf-attribute-select:focus {
    outline: none;
    border-color: var(--adf-accent);
}

/* ==========================================================================
   Customise Row
   ========================================================================== */
.adf-customise-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    margin-bottom: 0;
    padding: 20px 0;
    border-top: 1px solid var(--adf-text-primary);
}

.adf-customise-text {
    font-size: var(--adf-body-size);
    color: var(--adf-text-secondary);
}

/* Request a Quote button — matches main site: uppercase, light grey fill, white text */
.adf-customise-link,
.adf-product-display a.adf-customise-link {
    display: inline-block;
    font-family: var(--adf-font);
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--adf-white) !important;
    text-decoration: none !important;
    white-space: nowrap;
    padding: 12px 20px;
    border: none;
    border-radius: 0;
    background: #c7c6c5;
    transition: background-color var(--adf-transition);
}

.adf-customise-link:hover,
.adf-customise-link:focus,
.adf-product-display a.adf-customise-link:hover,
.adf-product-display a.adf-customise-link:focus {
    color: var(--adf-white) !important;
    background: var(--adf-accent);
}

/* ==========================================================================
   Add to Cart Button
   ========================================================================== */
.adf-add-to-cart,
.adf-product-display .adf-add-to-cart,
button.adf-add-to-cart {
    width: 100%;
    margin-top: 24px;
    padding: 16px 24px;
    font-family: var(--adf-font);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background-color: #2d2d2d !important;
    color: var(--adf-white) !important;
    border: none !important;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--adf-transition);
    position: relative;
}

.adf-add-to-cart:hover:not(:disabled),
.adf-product-display .adf-add-to-cart:hover:not(:disabled),
button.adf-add-to-cart:hover:not(:disabled),
.adf-add-to-cart:focus:not(:disabled),
.adf-add-to-cart:active:not(:disabled) {
    background-color: #bbaba2 !important;
    color: var(--adf-white) !important;
}

.adf-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.adf-add-to-cart .adf-btn-loading {
    display: none;
}

.adf-add-to-cart.loading .adf-btn-text {
    display: none;
}

.adf-add-to-cart.loading .adf-btn-loading {
    display: inline;
}

/* ==========================================================================
   Lead Time Notice
   ========================================================================== */
.adf-lead-time-notice {
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 0;
}

.adf-lead-time-notice strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--adf-text-primary);
    margin-bottom: 4px;
}

.adf-lead-time-notice p {
    font-size: 13px;
    color: var(--adf-text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* ==========================================================================
   Accordions
   ========================================================================== */
.adf-product-accordions {
    border-top: 1px solid var(--adf-text-primary);
}

.adf-accordion {
    border-bottom: 1px solid var(--adf-text-primary);
}

/* Accordion header — Sohne Kraftig */
.adf-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    font-family: var(--adf-font);
    font-size: 15px;
    font-weight: 500;
    color: var(--adf-text-primary) !important;
    background: none !important;
    background-color: transparent !important;
    border: none;
    cursor: pointer;
    text-align: left;
}

.adf-accordion-header:hover,
.adf-accordion-header:focus,
.adf-accordion-header:active,
.adf-product-display .adf-accordion-header:hover,
.adf-product-display .adf-accordion-header:focus,
.adf-product-display .adf-accordion-header:active {
    color: var(--adf-text-primary) !important;
    background: none !important;
    background-color: transparent !important;
}

.adf-accordion-icon {
    position: relative;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.adf-accordion-icon::before,
.adf-accordion-icon::after {
    content: '';
    position: absolute;
    background-color: var(--adf-text-primary);
    transition: transform var(--adf-transition);
}

.adf-accordion-icon::before {
    top: 50%;
    left: 0;
    width: 16px;
    height: 1px;
    transform: translateY(-50%);
}

.adf-accordion-icon::after {
    top: 0;
    left: 50%;
    width: 1px;
    height: 16px;
    transform: translateX(-50%);
}

.adf-accordion.open .adf-accordion-icon::after {
    transform: translateX(-50%) rotate(90deg);
    opacity: 0;
}

.adf-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.adf-accordion.open .adf-accordion-content {
    max-height: 1000px;
}

.adf-accordion-inner {
    padding: 0 0 24px 0;
    font-size: var(--adf-body-size);
    color: var(--adf-text-secondary);
    line-height: 1.7;
}

.adf-accordion-inner p {
    margin: 0 0 12px 0;
}

.adf-accordion-inner p:last-child {
    margin-bottom: 0;
}

.adf-accordion-inner ul {
    margin: 0;
    padding-left: 20px;
}

.adf-accordion-inner li {
    margin-bottom: 6px;
}

.adf-accordion-inner a {
    color: var(--adf-text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.adf-accordion-inner a:hover {
    color: var(--adf-accent);
}

/* Download Link */
.adf-download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--adf-text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

.adf-download-link:hover {
    color: var(--adf-accent);
}

/* Finishes & Upholstery */
.adf-finishes-copy {
    margin-bottom: 20px;
}

.adf-finish-group {
    margin-bottom: 24px;
}

.adf-finish-group:last-child {
    margin-bottom: 0;
}

.adf-finish-group-title {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--adf-text-primary);
    margin: 0 0 12px 0;
}

.adf-finish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.adf-finish-item {
    margin: 0;
}

.adf-finish-thumb {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    background-color: var(--adf-bg-light);
}

.adf-finish-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Shown while the client's photo has not been assigned yet */
.adf-finish-thumb-placeholder {
    border: 1px dashed var(--adf-border-dark);
}

.adf-finish-label {
    font-size: 12px;
    color: var(--adf-text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

@media screen and (max-width: 480px) {
    .adf-finish-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
}

/* Dimensions List */
.adf-dimensions-list {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
}

.adf-dimensions-list li {
    margin-bottom: 6px;
}

/* ==========================================================================
   Messages
   ========================================================================== */
.adf-message {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
}

.adf-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.adf-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media screen and (max-width: 1024px) {
    .adf-product-display {
        gap: 40px;
    }

    .adf-product-title {
        font-size: 22px;
    }
}

@media screen and (max-width: 768px) {
    .adf-product-display {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 24px 16px;
    }

    .adf-product-gallery,
    .adf-product-info {
        position: static;
    }

    .adf-gallery-images {
        gap: 12px;
    }

    .adf-product-title {
        font-size: 21px;
    }

    .adf-product-price {
        font-size: 20px;
    }

    .adf-customise-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .adf-attribute-swatches {
        gap: 10px;
    }

    .adf-swatch {
        width: 44px;
        height: 44px;
    }
}

@media screen and (max-width: 480px) {
    .adf-product-display {
        padding: 16px 12px;
    }

    .adf-product-title {
        font-size: 20px;
    }

    .adf-gallery-images {
        gap: 10px;
    }

    .adf-accordion-header {
        font-size: 14px;
        padding: 16px 0;
    }
}

/* ==========================================================================
   WooCommerce Overrides (when needed)
   ========================================================================== */
.adf-product-display .woocommerce-variation-price {
    display: none; /* We handle price display ourselves */
}

/* Hide default WooCommerce elements when our shortcode is active */
.adf-product-display-active .woocommerce-product-gallery,
.adf-product-display-active .product_title,
.adf-product-display-active .woocommerce-product-details__short-description,
.adf-product-display-active .price,
.adf-product-display-active .variations_form,
.adf-product-display-active .woocommerce-tabs {
    display: none !important;
}

/* ==========================================================================
   FAQ Display Styles
   ========================================================================== */
.adf-faqs-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.adf-faq-entry {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--adf-border);
}

.adf-faq-entry:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.adf-faq-entry .adf-faq-question {
    font-size: 15px;
    font-weight: 500;
    color: var(--adf-text-primary);
    margin: 0 0 8px 0;
}

.adf-faq-entry .adf-faq-answer {
    font-size: var(--adf-body-size);
    color: var(--adf-text-secondary);
    line-height: 1.7;
}

.adf-faq-entry .adf-faq-answer p {
    margin: 0;
}

.adf-faq-entry .adf-faq-answer p + p {
    margin-top: 10px;
}

/* ==========================================================================
   Elementor Loop Grid — hover image swap
   ========================================================================== */
.adf-loop-hover-wrapper {
    position: relative;
    display: block;
    overflow: hidden;
}

.adf-loop-hover-wrapper .adf-loop-image-primary {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: bottom center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.adf-loop-hover-wrapper .adf-loop-image-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: bottom center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.adf-loop-hover-wrapper:hover .adf-loop-image-primary {
    opacity: 0;
}

.adf-loop-hover-wrapper:hover .adf-loop-image-hover {
    opacity: 1;
}
