/**
 * WooCommerce Product Page - Comprehensive Style Guide
 *
 * Design System matching the aftercare section aesthetic
 * Applies to: All WooCommerce single product pages
 *
 * @version 1.0.0
 */

/* ============================================================================
   CSS Custom Properties (Design Tokens)
   ============================================================================ */

:root {
    /* Brand Colors */
    --hsgm-primary: #00AEEF;
    --hsgm-primary-hover: #0096D1;
    --hsgm-primary-light: #e6f7fd;

    /* Neutral Colors */
    --hsgm-gray-50: #f8f9fa;
    --hsgm-gray-100: #f1f3f5;
    --hsgm-gray-200: #e9ecef;
    --hsgm-gray-300: #dee2e6;
    --hsgm-gray-400: #ced4da;
    --hsgm-gray-500: #adb5bd;
    --hsgm-gray-600: #6c757d;
    --hsgm-gray-700: #495057;
    --hsgm-gray-800: #343a40;
    --hsgm-gray-900: #212529;

    /* Semantic Colors */
    --hsgm-success: #198754;
    --hsgm-success-light: #d1e7dd;
    --hsgm-warning: #ffc107;
    --hsgm-warning-light: #fff3cd;
    --hsgm-danger: #dc3545;
    --hsgm-danger-light: #f8d7da;
    --hsgm-info: #0d6efd;
    --hsgm-info-light: #cfe2ff;

    /* Typography */
    --hsgm-font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --hsgm-font-size-sm: 13px;
    --hsgm-font-size-base: 15px;
    --hsgm-font-size-lg: 17px;
    --hsgm-font-size-xl: 20px;
    --hsgm-font-size-2xl: 24px;

    /* Spacing */
    --hsgm-spacing-xs: 4px;
    --hsgm-spacing-sm: 8px;
    --hsgm-spacing-md: 16px;
    --hsgm-spacing-lg: 24px;
    --hsgm-spacing-xl: 32px;

    /* Border Radius */
    --hsgm-radius-sm: 4px;
    --hsgm-radius-md: 8px;
    --hsgm-radius-lg: 12px;
    --hsgm-radius-pill: 22px;

    /* Shadows */
    --hsgm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --hsgm-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --hsgm-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --hsgm-transition: all 0.2s ease;
}

/* ============================================================================
   Product Page Container
   ============================================================================ */

.single-product .product {
    font-family: var(--hsgm-font-family);
}

/* ============================================================================
   Price Display Enhancement
   ============================================================================ */

.single-product .product .price {
    font-size: var(--hsgm-font-size-2xl);
    font-weight: 700;
    color: var(--hsgm-gray-800);
    margin-bottom: var(--hsgm-spacing-md);
}

.single-product .product .price .woocommerce-Price-amount {
    color: var(--hsgm-primary);
}

.single-product .product .price del {
    color: var(--hsgm-gray-500);
    font-size: var(--hsgm-font-size-lg);
}

.single-product .product .price ins {
    text-decoration: none;
    color: var(--hsgm-success);
    font-weight: 700;
}

/* ============================================================================
   Variation Dropdowns (Camp, Date Selectors) - Minimal/Underline Style
   ============================================================================ */

/* Ensure variations form uses block layout, not flex-row which causes overflow */
.single-product .variations_form {
    display: block !important;
    width: 100% !important;
    height: auto !important;  /* Ensure form expands to contain children */
    overflow: visible !important;
    min-height: 0 !important;
}

/* Disable any scaling/transform effects on hover in variations area */
.single-product .variations_form,
.single-product .variations_form *,
.single-product .variations_form:hover,
.single-product .variations_form *:hover {
    transform: none !important;
}

/* Force the form to expand to its content height */
.single-product .variations_form.cart {
    height: auto !important;
    min-height: fit-content !important;
}

/* Remove ALL backgrounds from variations table
   Override parent theme's table tbody tr styling that adds gray backgrounds */
.single-product .variations_form,
.single-product .variations_form .variations,
.single-product .variations_form .variations tbody,
.single-product .variations_form .variations tr,
.single-product .variations_form .variations td,
.single-product .variations_form .variations th,
.single-product .variations_form .variations .label,
.single-product .variations_form .variations .value {
    background: transparent !important;
    background-color: transparent !important;
}

/* Override parent theme's alternating row colors: table tbody > tr:nth-child(odd) > td */
.single-product table.variations tbody > tr:nth-child(odd) > td,
.single-product table.variations tbody > tr:nth-child(odd) > th,
.single-product table.variations tbody > tr:nth-child(even) > td,
.single-product table.variations tbody > tr:nth-child(even) > th {
    background: transparent !important;
    background-color: transparent !important;
}

/* Override parent theme's table hover: table tbody tr:hover > td */
.single-product table.variations tbody tr:hover > td,
.single-product table.variations tbody tr:hover > th,
.single-product table.variations tbody tr:focus-within > td,
.single-product table.variations tbody tr:focus-within > th {
    background: transparent !important;
    background-color: transparent !important;
}

/* Remove backgrounds on ALL hover/focus states for variations area */
.single-product .variations_form:hover,
.single-product .variations_form .variations:hover,
.single-product .variations_form .variations tr:hover,
.single-product .variations_form .variations td:hover,
.single-product .variations_form .variations .label:hover,
.single-product .variations_form .variations .value:hover {
    background: transparent !important;
    background-color: transparent !important;
}

.single-product .variations_form .variations {
    padding: 0;
    border: none;
    margin-bottom: 12px !important;  /* 12px gap between last dropdown and next element */
}

.single-product .variations_form .variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px !important;  /* Consistent 12px gap between dropdowns */
    padding: 0 !important;
}

.single-product .variations_form .variations tr:last-child {
    margin-bottom: 0 !important;
}

.single-product .variations_form .variations .label {
    padding: 0;
    margin-bottom: var(--hsgm-spacing-xs);
}

.single-product .variations_form .variations .label label {
    font-weight: 600;
    font-size: var(--hsgm-font-size-sm);
    color: var(--hsgm-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.single-product .variations_form .variations .value {
    padding: 0;
}

/* Underline-style select dropdowns */
.single-product .variations_form .variations select {
    width: 100%;
    padding: var(--hsgm-spacing-sm) 0;
    font-size: var(--hsgm-font-size-base);
    font-family: var(--hsgm-font-family);
    border: none;
    border-bottom: 2px solid var(--hsgm-gray-300);
    border-radius: 0;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2300AEEF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 14px;
    appearance: none;
    cursor: pointer;
    transition: var(--hsgm-transition);
}

.single-product .variations_form .variations select:hover,
.single-product .variations_form .variations select:focus,
.single-product .variations_form .variations select:active {
    border-bottom-color: var(--hsgm-primary);
    background-color: transparent !important;
    outline: none;
    box-shadow: none;
}

/* Override any theme/browser default option styling */
.single-product .variations_form .variations select option {
    background-color: #fff;
    color: var(--hsgm-gray-800);
    padding: var(--hsgm-spacing-sm);
}

.single-product .variations_form .variations select option:hover,
.single-product .variations_form .variations select option:focus,
.single-product .variations_form .variations select option:checked {
    background-color: var(--hsgm-primary-light) !important;
    color: var(--hsgm-gray-800);
}

/* Clear link - hidden for cleaner UI */
.single-product .variations_form .reset_variations {
    display: none !important;
}

/* Single variation wrap - contains date picker and Add to Cart */
.single-product .single_variation_wrap {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure consistent 12px spacing between elements in the variation form */
.single-product .single_variation_wrap .woocommerce-variation-add-to-cart {
    gap: 12px !important;
}

/* ============================================================================
   Add to Cart Button Group (Quantity + Button)
   ============================================================================ */

/* Container for quantity and add to cart - make them inline and cohesive */
.single-product .woocommerce-variation-add-to-cart,
.single-product form.cart:not(.variations_form) .quantity + .single_add_to_cart_button {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: wrap;
}

/* Quantity wrapper - attach to button */
.single-product .quantity {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--hsgm-primary);
    border-radius: var(--hsgm-radius-pill) 0 0 var(--hsgm-radius-pill);
    border-right: none;
    background: #fff;
    overflow: hidden;
}

/* Quantity input - clean and minimal */
.single-product .quantity .qty {
    width: 60px;
    height: 44px;
    padding: 0 var(--hsgm-spacing-sm);
    font-size: var(--hsgm-font-size-base);
    font-family: var(--hsgm-font-family);
    font-weight: 600;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--hsgm-gray-800);
    -moz-appearance: textfield;
}

/* Hide spinner arrows for cleaner look */
.single-product .quantity .qty::-webkit-outer-spin-button,
.single-product .quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.single-product .quantity .qty:focus {
    outline: none;
    background: var(--hsgm-primary-light);
}

/* Add to cart button - connects to quantity */
.single-product .single_add_to_cart_button {
    background-color: var(--hsgm-primary) !important;
    color: #fff !important;
    font-family: var(--hsgm-font-family) !important;
    font-size: var(--hsgm-font-size-lg) !important;
    font-weight: 600 !important;
    height: 48px;
    padding: 0 var(--hsgm-spacing-xl) !important;
    border-radius: 0 var(--hsgm-radius-pill) var(--hsgm-radius-pill) 0 !important;
    border: 2px solid var(--hsgm-primary) !important;
    text-transform: none !important;
    transition: var(--hsgm-transition) !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.single-product .single_add_to_cart_button:hover,
.single-product .single_add_to_cart_button:focus {
    background-color: var(--hsgm-primary-hover) !important;
    border-color: var(--hsgm-primary-hover) !important;
    box-shadow: var(--hsgm-shadow-md);
}

.single-product .single_add_to_cart_button:active {
    box-shadow: var(--hsgm-shadow-sm);
}

/* When button is disabled */
.single-product .single_add_to_cart_button:disabled,
.single-product .single_add_to_cart_button.disabled {
    background-color: var(--hsgm-gray-400) !important;
    border-color: var(--hsgm-gray-400) !important;
    cursor: not-allowed;
}

/* ============================================================================
   Description Tab Enhancement
   ============================================================================ */

.single-product .woocommerce-tabs {
    margin-top: var(--hsgm-spacing-xl);
}

.single-product .woocommerce-tabs .tabs {
    padding: 0;
    margin: 0 0 var(--hsgm-spacing-md) 0;
    list-style: none;
    border-bottom: 2px solid var(--hsgm-gray-200);
}

.single-product .woocommerce-tabs .tabs li {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.single-product .woocommerce-tabs .tabs li a {
    display: block;
    padding: var(--hsgm-spacing-sm) var(--hsgm-spacing-lg);
    font-weight: 600;
    color: var(--hsgm-gray-600);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--hsgm-transition);
}

.single-product .woocommerce-tabs .tabs li a:hover {
    color: var(--hsgm-primary);
}

.single-product .woocommerce-tabs .tabs li.active a {
    color: var(--hsgm-primary);
    border-bottom-color: var(--hsgm-primary);
}

/* Description content */
.single-product .woocommerce-Tabs-panel {
    padding: var(--hsgm-spacing-lg) 0;
}

.single-product .woocommerce-Tabs-panel h2 {
    font-size: var(--hsgm-font-size-xl);
    font-weight: 700;
    color: var(--hsgm-gray-800);
    margin-bottom: var(--hsgm-spacing-md);
}

.single-product .woocommerce-Tabs-panel h3 {
    font-size: var(--hsgm-font-size-lg);
    font-weight: 700;
    color: var(--hsgm-gray-800);
    margin: var(--hsgm-spacing-lg) 0 var(--hsgm-spacing-md) 0;
}

/* ============================================================================
   Callout Boxes for Description Content
   ============================================================================ */

/* Base callout style */
.hsgm-callout {
    padding: var(--hsgm-spacing-md);
    border-radius: var(--hsgm-radius-md);
    margin: var(--hsgm-spacing-md) 0;
    border-left: 4px solid;
}

.hsgm-callout-title {
    font-weight: 700;
    margin-bottom: var(--hsgm-spacing-xs);
}

/* Success/Highlight callout (T-shirt included, etc.) */
.hsgm-callout-success {
    background: var(--hsgm-success-light);
    border-color: var(--hsgm-success);
}

.hsgm-callout-success .hsgm-callout-title {
    color: var(--hsgm-success);
}

/* Info callout (General info) */
.hsgm-callout-info {
    background: var(--hsgm-info-light);
    border-color: var(--hsgm-info);
}

.hsgm-callout-info .hsgm-callout-title {
    color: var(--hsgm-info);
}

/* Warning callout (Refund policy, etc.) */
.hsgm-callout-warning {
    background: var(--hsgm-warning-light);
    border-color: var(--hsgm-warning);
}

.hsgm-callout-warning .hsgm-callout-title {
    color: var(--hsgm-gray-800);
}

/* Danger/Important callout (Waiver, etc.) */
.hsgm-callout-danger {
    background: var(--hsgm-danger-light);
    border-color: var(--hsgm-danger);
}

.hsgm-callout-danger .hsgm-callout-title {
    color: var(--hsgm-danger);
}

/* ============================================================================
   Enhanced List Styling
   ============================================================================ */

.single-product .woocommerce-Tabs-panel ul {
    list-style: none;
    padding: 0;
    margin: var(--hsgm-spacing-md) 0;
}

.single-product .woocommerce-Tabs-panel ul li {
    position: relative;
    padding-left: var(--hsgm-spacing-lg);
    margin-bottom: var(--hsgm-spacing-sm);
    line-height: 1.6;
}

.single-product .woocommerce-Tabs-panel ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--hsgm-primary);
    font-weight: bold;
}

/* Feature list items */
.hsgm-feature-list li::before {
    content: "✓" !important;
    color: var(--hsgm-success);
    font-weight: bold;
}

/* ============================================================================
   Info Cards (Aftercare Options, Meals, etc.)
   ============================================================================ */

.hsgm-info-card {
    background: var(--hsgm-gray-50);
    border: 1px solid var(--hsgm-gray-200);
    border-radius: var(--hsgm-radius-md);
    padding: var(--hsgm-spacing-md);
    margin: var(--hsgm-spacing-md) 0;
}

.hsgm-info-card-header {
    display: flex;
    align-items: center;
    gap: var(--hsgm-spacing-sm);
    margin-bottom: var(--hsgm-spacing-sm);
}

.hsgm-info-card-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hsgm-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
}

.hsgm-info-card-title {
    font-weight: 700;
    color: var(--hsgm-gray-800);
}

.hsgm-info-card-content {
    color: var(--hsgm-gray-700);
    line-height: 1.6;
}

/* Pricing info card variant */
.hsgm-info-card-pricing {
    display: flex;
    flex-wrap: wrap;
    gap: var(--hsgm-spacing-md);
}

.hsgm-price-item {
    background: #fff;
    border: 1px solid var(--hsgm-gray-300);
    border-radius: var(--hsgm-radius-sm);
    padding: var(--hsgm-spacing-sm) var(--hsgm-spacing-md);
    display: flex;
    align-items: center;
    gap: var(--hsgm-spacing-sm);
}

.hsgm-price-item-label {
    color: var(--hsgm-gray-700);
}

.hsgm-price-item-value {
    font-weight: 700;
    color: var(--hsgm-success);
}

/* ============================================================================
   Product Meta (SKU, Category)
   ============================================================================ */

/* Ensure product meta appears AFTER the form using flexbox order
   The summary container needs to be flex for this to work */
.single-product .summary.entry-summary {
    display: flex !important;
    flex-direction: column !important;
}

/* Ensure all direct children have proper order:
   1. Title (order 1)
   2. Price (order 2)
   3. Short description (order 3)
   4. Form (order 4)
   5. Product meta (order 5) - LAST */
.single-product .summary.entry-summary > .product_title {
    order: 1 !important;
}

.single-product .summary.entry-summary > .price {
    order: 2 !important;
}

.single-product .summary.entry-summary > .woocommerce-product-details__short-description {
    order: 3 !important;
}

.single-product .summary.entry-summary > .variations_form.cart,
.single-product .summary.entry-summary > form.cart {
    order: 4 !important;
}

/* Push product_meta to the end, after the form */
.single-product .product_meta {
    order: 99 !important;  /* Very high order to ensure it's last */
    margin-top: var(--hsgm-spacing-lg) !important;
    padding-top: var(--hsgm-spacing-md);
    border-top: 1px solid var(--hsgm-gray-200);
    font-size: var(--hsgm-font-size-sm);
    color: var(--hsgm-gray-600);
    /* Clear any conflicting positioning */
    position: relative !important;
    z-index: 1;
}

.single-product .product_meta > span {
    display: block;
    margin-bottom: var(--hsgm-spacing-xs);
}

.single-product .product_meta a {
    color: var(--hsgm-primary);
    text-decoration: none;
    transition: var(--hsgm-transition);
}

.single-product .product_meta a:hover {
    color: var(--hsgm-primary-hover);
    text-decoration: underline;
}

/* ============================================================================
   Breadcrumb Enhancement
   ============================================================================ */

.single-product .woocommerce-breadcrumb {
    font-size: var(--hsgm-font-size-sm);
    color: var(--hsgm-gray-600);
    margin-bottom: var(--hsgm-spacing-md);
    padding-top: var(--hsgm-spacing-lg);  /* Add padding above breadcrumbs */
}

.single-product .woocommerce-breadcrumb a {
    color: var(--hsgm-gray-600);
    text-decoration: none;
    transition: var(--hsgm-transition);
}

.single-product .woocommerce-breadcrumb a:hover {
    color: var(--hsgm-primary);
}

/* ============================================================================
   Aftercare Section Styling (Override Plugin Inline Styles)
   ============================================================================ */

/* When aftercare section is present, ensure proper stacking layout */
.single-product .woocommerce-variation-add-to-cart:has(.hsgm-aftercare-options) {
    flex-wrap: wrap !important;
}

/* Remove gray background box, use clean minimal style */
/* Make aftercare section full width to force quantity+button to new row */
.single-product .hsgm-aftercare-options {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 0 var(--hsgm-spacing-lg) 0 !important;
    flex: 0 0 100% !important;
    width: 100% !important;
}

/* Aftercare label - match variation labels, centered */
.single-product .hsgm-aftercare-label {
    margin: 0 0 var(--hsgm-spacing-sm) 0 !important;
    text-align: center !important;
}

.single-product .hsgm-aftercare-label strong {
    font-weight: 600 !important;
    font-size: var(--hsgm-font-size-sm) !important;
    color: var(--hsgm-gray-600) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Radio button container - horizontal inline layout */
.single-product .hsgm-aftercare-radios {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: var(--hsgm-spacing-sm) !important;
}

/* Radio button options - clean pill style
   NOTE: Don't use !important on display - it breaks JavaScript show/hide */
.single-product .hsgm-aftercare-radio {
    align-items: center !important;
    padding: var(--hsgm-spacing-sm) var(--hsgm-spacing-md) !important;
    background: #fff !important;
    border: 2px solid var(--hsgm-gray-300) !important;
    border-radius: var(--hsgm-radius-pill) !important;
    cursor: pointer !important;
    transition: var(--hsgm-transition) !important;
    margin: 0 !important;
}

/* Only apply inline-flex when element is visible (not hidden by JS) */
.single-product .hsgm-aftercare-radio:not([style*="display: none"]):not([style*="display:none"]) {
    display: inline-flex;
}

.single-product .hsgm-aftercare-radio:hover {
    border-color: var(--hsgm-primary) !important;
    background: var(--hsgm-primary-light) !important;
}

/* Selected state */
.single-product .hsgm-aftercare-radio:has(input:checked) {
    border-color: var(--hsgm-primary) !important;
    background: var(--hsgm-primary-light) !important;
}

/* Radio input styling */
.single-product .hsgm-aftercare-radio input[type="radio"] {
    width: 16px !important;
    height: 16px !important;
    margin: 0 var(--hsgm-spacing-xs) 0 0 !important;
    accent-color: var(--hsgm-primary) !important;
}

/* Radio text */
.single-product .hsgm-aftercare-text {
    font-size: var(--hsgm-font-size-sm) !important;
    color: var(--hsgm-gray-800) !important;
    font-weight: 500 !important;
}

/* Price highlight */
.single-product .hsgm-aftercare-price {
    color: var(--hsgm-success) !important;
    font-weight: 600 !important;
    margin-left: var(--hsgm-spacing-xs) !important;
}

/* ============================================================================
   Date Picker Field Styling (Birthday Pawty, etc.)
   ============================================================================ */

/* When date picker is present, use vertical column layout for compact stack */
.single-product .woocommerce-variation-add-to-cart:has(input[name*="date"]),
.single-product .woocommerce-variation-add-to-cart:has(input.hasDatepicker) {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: var(--hsgm-spacing-md) !important;
}

/* Date picker paragraph - full width, minimal margins (gap handled by container) */
.single-product .woocommerce-variation-add-to-cart p:has(input[type="text"]),
.single-product .woocommerce-variation-add-to-cart p:has(input[name*="date"]),
.single-product .woocommerce-variation-add-to-cart p:has(input.hasDatepicker) {
    flex: 0 0 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Date picker label styling - matches variation labels, centered */
.single-product .woocommerce-variation-add-to-cart p > label,
.single-product .woocommerce-variation-add-to-cart p > span:first-child,
.single-product form.cart p > label[for*="date"],
.single-product form.cart p > span:first-child {
    display: block;
    font-weight: 600;
    font-size: var(--hsgm-font-size-sm);
    color: var(--hsgm-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--hsgm-spacing-xs);
    text-align: center;
}

/* Hide "Choose a party date:" label text and replace without colon
   Using visibility + absolute positioning to completely hide original text */
.single-product .woocommerce-variation-add-to-cart p > label[for*="date"],
.single-product .woocommerce-variation-add-to-cart p > label[for*="party"] {
    position: relative;
    visibility: hidden;
    display: block;
    height: 1.5em;  /* Reserve space for the ::before content */
}

.single-product .woocommerce-variation-add-to-cart p > label[for*="date"]::before,
.single-product .woocommerce-variation-add-to-cart p > label[for*="party"]::before {
    content: "Choose a party date";
    visibility: visible;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    font-family: var(--hsgm-font-family);
    font-size: var(--hsgm-font-size-sm);
    color: var(--hsgm-gray-600);
    font-weight: 700;  /* Match variation labels (700 not 600) */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Date picker input - underline style to match dropdowns */
.single-product input[type="text"][placeholder*="date"],
.single-product input[type="text"][placeholder*="Date"],
.single-product input.datepicker,
.single-product input[id*="date"],
.single-product input[name*="date"] {
    width: 100%;
    padding: var(--hsgm-spacing-sm) 0;
    font-size: var(--hsgm-font-size-base);
    font-family: var(--hsgm-font-family);
    color: var(--hsgm-gray-800);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--hsgm-gray-300);
    border-radius: 0;
    outline: none;
    transition: var(--hsgm-transition);
    cursor: pointer;
}

.single-product input[type="text"][placeholder*="date"]:hover,
.single-product input[type="text"][placeholder*="date"]:focus,
.single-product input[type="text"][placeholder*="Date"]:hover,
.single-product input[type="text"][placeholder*="Date"]:focus,
.single-product input.datepicker:hover,
.single-product input.datepicker:focus {
    border-bottom-color: var(--hsgm-primary);
    background: transparent;
    box-shadow: none;
}

/* ============================================================================
   Deposit Notice Message (Birthday Pawty)
   ============================================================================ */

.hsgm-deposit-notice {
    display: none;  /* Hidden by default, shown via JS when deposit selected */
    background: var(--hsgm-info-light);
    border: 1px solid var(--hsgm-info);
    border-left: 4px solid var(--hsgm-info);
    border-radius: var(--hsgm-radius-md);
    padding: var(--hsgm-spacing-sm) var(--hsgm-spacing-md);
    margin: var(--hsgm-spacing-sm) 0;
    font-size: var(--hsgm-font-size-sm);
    color: var(--hsgm-gray-700);
    text-align: center;
}

.hsgm-deposit-notice.visible {
    display: block;
}

.hsgm-deposit-notice strong {
    color: var(--hsgm-info);
}

/* ============================================================================
   Add to Cart Button - Standalone (When Quantity is Hidden)
   ============================================================================ */

/* When quantity wrapper is hidden or not present, give button full pill shape */
.single-product .woocommerce-variation-add-to-cart .quantity[style*="display: none"] + .single_add_to_cart_button,
.single-product .woocommerce-variation-add-to-cart .quantity:empty + .single_add_to_cart_button,
.single-product .woocommerce-variation-add-to-cart > .single_add_to_cart_button:first-child,
.single-product form.cart:not(.variations_form) > .single_add_to_cart_button:only-child {
    border-radius: var(--hsgm-radius-pill) !important;
}

/* Alternative: When quantity has display:none via inline style */
.single-product .quantity[style*="display:none"] + .single_add_to_cart_button,
.single-product .quantity[style*="display: none"] + .single_add_to_cart_button {
    border-radius: var(--hsgm-radius-pill) !important;
}

/* Handle case where quantity wrapper exists but is visually hidden */
.single-product .woocommerce-variation-add-to-cart:not(:has(.quantity:not([style*="display"]))) .single_add_to_cart_button {
    border-radius: var(--hsgm-radius-pill) !important;
}

/* Button in date picker context - full width, centered */
.single-product .woocommerce-variation-add-to-cart:has(input[name*="date"]) .single_add_to_cart_button,
.single-product .woocommerce-variation-add-to-cart:has(input.hasDatepicker) .single_add_to_cart_button {
    width: 100% !important;
    max-width: 280px !important;
    align-self: center !important;
    border-radius: var(--hsgm-radius-pill) !important;
}

/* ============================================================================
   Mobile Responsiveness
   ============================================================================ */

@media (max-width: 768px) {
    .single-product .variations_form .variations {
        padding: var(--hsgm-spacing-md);
    }

    .single-product .woocommerce-tabs .tabs li a {
        padding: var(--hsgm-spacing-sm) var(--hsgm-spacing-md);
        font-size: var(--hsgm-font-size-sm);
    }

    .hsgm-info-card-pricing {
        flex-direction: column;
    }

    .hsgm-price-item {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .single-product .price {
        font-size: var(--hsgm-font-size-xl);
    }

    /* Stack quantity and button on very small screens */
    .single-product .woocommerce-variation-add-to-cart {
        flex-direction: column;
        gap: var(--hsgm-spacing-sm);
    }

    .single-product .quantity {
        border-radius: var(--hsgm-radius-pill);
        border-right: 2px solid var(--hsgm-primary);
        justify-content: center;
    }

    .single-product .quantity .qty {
        width: 100%;
        max-width: 120px;
    }

    .single-product .single_add_to_cart_button {
        width: 100%;
        border-radius: var(--hsgm-radius-pill) !important;
        justify-content: center;
    }
}

/* ============================================================================
   Accessibility
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .single-product .single_add_to_cart_button,
    .single-product .variations_form .variations select,
    .single-product .woocommerce-tabs .tabs li a,
    .single-product .product_meta a {
        transition: none !important;
    }
}

/* Focus visible styles for keyboard navigation */
.single-product *:focus-visible {
    outline: 2px solid var(--hsgm-primary);
    outline-offset: 2px;
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    .single-product .single_add_to_cart_button,
    .single-product .variations_form,
    .hsgm-aftercare-options {
        display: none;
    }

    .single-product .woocommerce-Tabs-panel {
        page-break-inside: avoid;
    }
}
