/*
Theme Name: Aquavale Core
Theme URI: https://aquavale.com.au/
Description: Custom child theme for Aquavale.
Author: Aquavale
Version: 1.0.0
Template: blocksy
Text Domain: aquavale-core
*/

/*
Do not add major CSS here yet.
This file exists to register the child theme.
Custom CSS will be moved into proper assets later.
*/

/* ==========================================================================
   WooCommerce category bottom description
   ========================================================================== */

.av-category-bottom-description {
    margin-top: 40px;
    padding-top: 20px;
}

.av-category-bottom-description h2,
.av-category-bottom-description h3 {
    margin-top: 30px;
}

.av-category-bottom-description p {
    margin-bottom: 16px;
}

/* ==========================================================================
   Request Callback / Found it cheaper popup
   ========================================================================== */

.av-request-callback-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.av-request-callback-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.av-request-callback-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

@media (max-width: 768px) {
    .av-request-callback-modal.is-open {
        align-items: flex-start;
        padding: 60px 16px 24px;
    }

    .av-request-callback-modal__dialog {
        width: 100%;
        max-height: calc(100dvh - 84px);
        padding: 28px;
    }
}

.av-request-callback-modal__dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    margin: 0;
    padding: 28px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.av-request-callback-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.av-request-callback-modal__product {
    margin-bottom: 18px;
    font-weight: 600;
}

.av-request-callback-modal__form {
    display: none;
}

.av-request-callback-modal__form.is-active {
    display: block;
}

body.av-callback-modal-open {
    overflow: hidden;
}

/* Hide modal title visually, but keep it available for accessibility */
#av-request-callback-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Single product action buttons
   ========================================================================== */

/* Custom Request Callback button on single product pages */
.single-product .av-request-callback-trigger.single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    text-align: center;
}

/* Secondary "Found it cheaper?" button on single product pages */
.single-product .av-single-found-cheaper-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    width: 100%;
    min-height: 50px;
    text-align: center;
    background: transparent !important;
    color: var(--theme-button-background-initial-color, #0f3d3e) !important;
    border: 1px solid var(--theme-button-background-initial-color, #0f3d3e) !important;
}

/* Hover/focus state for secondary button */
.single-product .av-single-found-cheaper-trigger:hover,
.single-product .av-single-found-cheaper-trigger:focus {
    background: var(--theme-button-background-initial-color, #0f3d3e) !important;
    color: #ffffff !important;
}

/* Keep spacing between the cart form and the secondary button */
.single-product form.cart + .av-single-found-cheaper-trigger {
    margin-top: 12px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .single-product .av-request-callback-trigger.single_add_to_cart_button,
    .single-product .av-single-found-cheaper-trigger {
        width: 100%;
        min-height: 50px;
        font-size: 15px;
    }

    .single-product .av-single-found-cheaper-trigger {
        margin-top: 10px;
    }
}

/* ==========================================================================
   Product grid callback link
   ========================================================================== */

.woocommerce ul.products li.product .av-loop-callback-trigger,
.ct-products-container .product .av-loop-callback-trigger {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: initial;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    font: inherit;
    font-weight: 600;
    line-height: inherit;
    text-align: center;
    cursor: pointer;
}

.woocommerce ul.products li.product .av-loop-callback-trigger:hover,
.woocommerce ul.products li.product .av-loop-callback-trigger:focus,
.ct-products-container .product .av-loop-callback-trigger:hover,
.ct-products-container .product .av-loop-callback-trigger:focus {
    background: transparent !important;
    box-shadow: none !important;
    color: var(--theme-link-hover-color, var(--theme-palette-color-1, #0f3d3e)) !important;
}

/* ==========================================================================
   Checkout terms validation highlight
   ========================================================================== */

.woocommerce-checkout .av-terms-error,
.woocommerce-checkout .woocommerce-invalid #terms {
    border-color: #d63638 !important;
}

.woocommerce-checkout .av-terms-error {
    padding: 14px 16px;
    border: 1px solid #d63638;
    border-radius: 10px;
    background: rgba(214, 54, 56, 0.06);
}

.woocommerce-checkout .av-terms-error label,
.woocommerce-checkout .av-terms-error a {
    color: #d63638 !important;
}

.woocommerce-checkout #terms.av-terms-checkbox-error {
    outline: 2px solid #d63638;
    outline-offset: 3px;
}

.woocommerce-checkout .av-terms-error-message {
    display: block;
    margin-top: 8px;
    color: #d63638;
    font-size: 14px;
    font-weight: 600;
}

/* ==========================================================================
   Product card callback button
   ========================================================================== */

button.av-request-callback-trigger.av-loop-callback-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 40px;
  padding: 0 16px;

  appearance: none;
  cursor: pointer;
  user-select: none;

  color: var(--theme-button-text-initial-color);
  background-color: var(--theme-button-background-initial-color);
  border: var(--theme-button-border);
  border-radius: var(--theme-button-border-radius, 100px);

  font-family: var(--theme-button-font-family, var(--theme-font-family));
  font-size: var(--theme-button-font-size);
  font-weight: var(--theme-button-font-weight);
  line-height: 1;
  text-decoration: none;

  transition: all .12s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

button.av-request-callback-trigger.av-loop-callback-trigger:hover,
button.av-request-callback-trigger.av-loop-callback-trigger:focus {
  color: var(--theme-button-text-hover-color);
  background-color: var(--theme-button-background-hover-color);
  text-decoration: none;
}