/**
 * ShapeScale Desktop Product Display Enhancements
 * Styles for recurring payment display, product-specific badges, and prepaid messaging
 * Part of Issue #286 - Mobile + Desktop checkout recurring payment display enhancements
 *
 * @version 1.0.0
 * @author ShapeScale Team
 */

/* ========================================
   BILLING FREQUENCY (Desktop)
   ======================================== */
.ss_billing_frequency {
    white-space: nowrap;
}

/* ========================================
   EQUIVALENT RATE BREAKDOWN (Under Subtotal)
   ======================================== */
.ss_equiv_rate_breakdown {
    font-size: 13px;
    color: #6b7280; /* Gray-500 - subdued */
    line-height: 1.5;
    padding-left: 16px; /* Indent under subtotal */
    margin-top: 4px;
    margin-bottom: 12px;
    font-style: normal;
}

/* ========================================
   PREPAID EXPLANATION NOTE
   ======================================== */
.ss_prepaid_note {
    font-size: .7rem;
    color: #6b7280; /* Gray-500 - subtle fine print */
    line-height: 1.6;
    margin-top: 12px;
    padding: 0;
    background: transparent;
    border: none;
    font-style: italic;
}

.ss_prepaid_note::before {
    content: '';
    display: none;
}

/* ========================================
   RECURRING BILLING INFO - MERGED INTO DESCRIPTION (Issue #286)
   ======================================== */

/* Recurring billing info now merged into product description.
 * SVG refresh icon used instead of calendar emoji.
 * Hide any leftover standalone recurring info elements.
 */
.ss_recurring_info {
    display: none !important;
}

/* Product description styling for merged recurring info */
.ss_product_description {
    line-height: 1.6;
}

.ss_product_description svg {
    color: #5C81FF;
    width: 1rem;
    height: 1rem;
    display: inline-block;
    vertical-align: text-bottom;
    margin-right: 4px;
}

/* ========================================
   TRUST BADGES - REMOVED FROM DESKTOP (Issue #286)
   ======================================== */

/* Trust badges removed from desktop per user request.
 * Mobile trust badges remain active via mobile-sticky-header-enhancements.css
 */
.ss_trust_badges {
    display: none !important;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

/* Tablet screens */
@media screen and (width <= 991px) {
    .ss_equiv_rate_breakdown {
        font-size: 12px;
        padding-left: 12px;
        margin-bottom: 10px;
    }

    .ss_prepaid_note {
        font-size: .65rem;
    }

    .ss_product_description svg {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* Large desktop screens */
@media screen and (width >= 1440px) {
    .ss_prepaid_note {
        font-size: .7rem;
    }

    .ss_product_description svg {
        width: 1.125rem;
        height: 1.125rem;
    }
}

/* ========================================
   ORDER SUMMARY TOTAL ROW
   ======================================== */

/* Total row - centered between dividers with equal spacing */
.ss_total_row {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

/* Dividers around total row - consistent spacing */
.ss_total_row + .divider,
.ss_total_row + hr {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus states for interactive elements */
.ss_trust_badge:focus-within {
    outline: 2px solid #3b82f6; /* Blue-500 */
    outline-offset: 2px;
    border-radius: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ss_prepaid_note {
        color: #374151; /* Gray-700 - darker for better contrast */
    }

    .ss_equiv_rate_breakdown {
        color: #374151; /* Gray-700 - darker for better contrast */
    }

    .ss_product_description svg {
        stroke: #3b4ecc; /* Darker blue for high contrast */
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ss_prepaid_note,
    .ss_equiv_rate_breakdown {
        transition: none;
    }
}

/* ========================================
   DARK MODE SUPPORT (Future-proofing)
   ======================================== */
@media (prefers-color-scheme: dark) {
    .ss_equiv_rate_breakdown {
        color: #9ca3af; /* Gray-400 - subtle in dark mode */
    }

    .ss_prepaid_note {
        color: #9ca3af; /* Gray-400 - subtle in dark mode */
    }

    .ss_product_description svg {
        stroke: #93c5fd; /* Blue-300 for dark mode */
    }
}

/* ========================================
   INTEGRATION WITH WEBFLOW STYLES
   ======================================== */

/* Ensure compatibility with existing Webflow checkout styles */
.ss_product_breakdown .ss_prepaid_note,
.ss_product_breakdown .ss_product_description,
.ss_product_breakdown .ss_equiv_rate_breakdown {
    width: 100%;
    box-sizing: border-box;
}

/* Ensure proper spacing within product breakdown container */
.ss_product_breakdown > .ss_equiv_rate_breakdown {
    margin-top: 4px;
}

.ss_product_breakdown > .ss_prepaid_note:first-child,
.ss_product_breakdown > .ss_product_description:first-child,
.ss_product_breakdown > .ss_equiv_rate_breakdown:first-child {
    margin-top: 0;
}

/* ========================================
   LOADING ANIMATION COMPATIBILITY
   ======================================== */

/* Ensure loading text displays correctly within new elements */
.ss_prepaid_note .ss-loading-text,
.ss_product_description .ss-loading-text,
.ss_equiv_rate_breakdown .ss-loading-text {
    display: inline-block;
    width: 80px;
    height: 1em;
    background: linear-gradient(90deg, #e5e7eb 25%, #d1d5db 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   URGENCY INDICATORS (Issue #295)
   ======================================== */

/* Desktop urgency indicators - subtle inline style */
.ss-urgency-desktop {
    margin: 8px 0;
}

.ss-urgency-row {
    padding: 4px 0;
    opacity: 0.95;
}

.ss-urgency-icon {
    color: #5C81FF;
}

.ss-urgency-row .text-size-small,
.ss-urgency-row .text-size-tiny-3 {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    display: inline !important; /* Override Webflow flex to preserve text spacing */
}

/* Stock and view counts - slightly emphasized */
.ss-stock-count,
.ss-view-count {
    font-weight: 600;
    color: #374151;
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Mobile urgency badges */
.ss-urgency-badge-stock,
.ss-urgency-badge-views {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

/* Remove checkmarks from urgency badges */
.ss-urgency-badge-stock::before,
.ss-urgency-badge-views::before {
    content: none !important;
    display: none !important;
}

/* Mobile urgency icons */
.ss-urgency-mobile-icon {
    display: inline-block;
    vertical-align: middle;
    color: #5C81FF;
}

.ss-urgency-mobile-icon svg {
    stroke: #5C81FF;
    width: 14px;
    height: 14px;
}

.ss-urgency-badge-stock .ss-stock-count,
.ss-urgency-badge-views .ss-view-count {
    font-weight: 600;
    color: #374151;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS (Urgency)
   ======================================== */

/* Tablet screens */
@media screen and (width <= 991px) {
    .ss-urgency-desktop {
        display: none !important;
    }

    .ss-urgency-badge-stock,
    .ss-urgency-badge-views {
        font-size: 12px;
    }
}

/* Large desktop screens */
@media screen and (width >= 1440px) {
    .ss-urgency-row .text-size-small,
    .ss-urgency-row .text-size-tiny-3 {
        font-size: 12px;
        display: inline !important;
    }
}

/* ========================================
   ACCESSIBILITY (Urgency)
   ======================================== */

/* Focus states for urgency elements */
.ss-urgency-row:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ss-urgency-row .text-size-small,
    .ss-urgency-row .text-size-tiny-3,
    .ss-urgency-badge-stock,
    .ss-urgency-badge-views {
        color: #374151;
        display: inline !important;
    }

    .ss-stock-count,
    .ss-view-count {
        color: #111827;
    }

    .ss-urgency-icon {
        color: #374151;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ss-stock-count,
    .ss-view-count {
        transition: none;
    }
}

/* ========================================
   MATRIX SHIMMER EFFECT (Urgency Counter)
   ======================================== */

/* Matrix shimmer for urgency view counter updates */
.ss-urgency-matrix-shimmer {
    display: inline-block;
    position: relative;
    color: transparent !important;
    background: linear-gradient(90deg,
        #5C81FF 0%,
        #7C9AFF 25%,
        #9BB3FF 50%,
        #7C9AFF 75%,
        #5C81FF 100%
    ) !important;
    background-size: 200% 100% !important;
    background-clip: text !important;
    animation: urgency-matrix-shimmer 0.8s ease-in-out 1 !important;
}

@keyframes urgency-matrix-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   DARK MODE SUPPORT (Urgency)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .ss-urgency-row .text-size-small,
    .ss-urgency-row .text-size-tiny-3,
    .ss-urgency-badge-stock,
    .ss-urgency-badge-views {
        color: #9ca3af;
        display: inline !important;
    }

    /* Match specificity of light mode selectors for proper override */
    .ss-stock-count,
    .ss-view-count,
    .ss-urgency-badge-stock .ss-stock-count,
    .ss-urgency-badge-views .ss-view-count {
        color: #e5e7eb;
    }

    .ss-urgency-icon,
    .ss-urgency-mobile-icon,
    .ss-urgency-mobile-icon svg {
        color: #5C81FF;
        stroke: #5C81FF;
    }

    /* Dark mode matrix shimmer - brighter blue */
    .ss-urgency-matrix-shimmer {
        background: linear-gradient(90deg,
            #7C9AFF 0%,
            #9BB3FF 25%,
            #BACFFF 50%,
            #9BB3FF 75%,
            #7C9AFF 100%
        ) !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .ss_prepaid_note {
        color: #000;
    }

    .ss_equiv_rate_breakdown {
        color: #000;
    }

    .ss_product_description svg {
        stroke: #000;
    }

    /* Hide urgency indicators in print */
    .ss-urgency-desktop,
    .ss-urgency-badge-stock,
    .ss-urgency-badge-views {
        display: none !important;
    }
}

/* ========================================
   PAYMENT ICON LIGHT/DARK MODE SWITCHING
   ======================================== */

/* Light mode: Show light icons, hide dark icons */
.ss_payment_icon_light {
    display: inline-block !important;
}

.ss_payment_icon_dark {
    display: none !important;
}

/* ========================================
   DARK MODE SUPPORT (Issue #270)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* ============================================================================
       DESKTOP ORDER SUMMARY SIDEBAR DARK MODE (Issue #270)
       ============================================================================
       Dark mode styles for customer collection page desktop order summary sidebar.
       This sidebar is hidden on mobile (<767px) and shows the full order breakdown
       with product image, pricing details, trust signals, and support info.

       Components styled:
       - Summary column container (.ss_summary_col)
       - Section header (.ss_section_header)
       - Product breakdown section (.ss_product_breakdown)
       - Product details (.ss_product_name, .ss_billing_frequency, .ss_product_description)
       - Pricing breakdown (.ss_pricing_breakdown)
       - Price rows (.ss_price_row, .ss_discount_line, .ss_total_row)
       - Trust signals (.ss_trust_signals)
       - Support section (.ss_support_section)

       Design principles:
       - Matches mobile sticky summary styling for consistency
       - Uses card-style background with subtle borders
       - Maintains visual hierarchy with appropriate contrast levels
       - WCAG 2.2 AA compliant contrast ratios
       ============================================================================ */

    /* Desktop Summary Column Container - Modern 2025 Elevated Card */
    .ss_summary_col {
        background: linear-gradient(135deg, rgb(30 30 35 / 95%) 0%, rgb(25 25 30 / 98%) 100%) !important;
        border: 1px solid rgb(255 255 255 / 8%) !important;
        box-shadow: 0 8px 32px rgb(0 0 0 / 40%), 0 2px 8px rgb(0 0 0 / 20%) !important;
    }

    /* Section Header - Modern 2025 with subtle accent */
    .ss_section_header {
        color: #e0e7ff !important; /* Indigo-100 for prominence */
        border-bottom: none !important;
        text-shadow: 0 0 20px rgb(99 102 241 / 15%) !important;
    }

    /* Product Breakdown Section - Remove border, use spacing */
    .ss_product_breakdown {
        background-color: transparent !important;
        border-bottom: none !important;
    }

    /* Product Image - Clean, natural appearance */
    .ss_chkout-img {
        opacity: 0.95 !important;
        filter: brightness(1.08) contrast(1.02) !important;
    }

    /* Product Name - Brighter for better readability */
    .ss_product_name {
        color: #f3f4f6 !important; /* Gray-100 - much brighter */
    }

    /* Billing Frequency - Brighter */
    .ss_billing_frequency {
        color: #e5e7eb !important; /* Gray-200 */
    }

    /* Product Description - More visible */
    .ss_product_description {
        color: #d1d5db !important; /* Gray-300 */
    }

    /* Pricing Breakdown Container - Clean, no background */
    .ss_pricing_breakdown {
        background: transparent !important;
        border-bottom: none !important;
    }

    /* Price Rows - Brighter for better readability */
    .ss_price_row {
        color: #e5e7eb !important; /* Gray-200 - brighter */
        border-bottom: none !important;
    }

    /* Shipping & taxes note within price rows */
    .ss_price_row .text-size-small {
        color: #d1d5db !important; /* Gray-300 - more visible */
    }

    /* Discount Row - green accent */
    .ss_discount_line {
        color: #5bb5a2 !important; /* Dark accent */
    }

    .ss_discount_line div {
        color: #5bb5a2 !important;
    }

    /* Discount Amount - dynamic value */
    .discount-amount,
    #discount-amount {
        color: #5bb5a2 !important;
    }

    /* Total Row - Clean, hierarchy through typography only */
    .ss_total_row {
        color: #f9fafb !important; /* Gray-50 - brightest */
        background: transparent !important;
    }

    .ss_total_row div {
        color: #f9fafb !important; /* Gray-50 - brightest */
    }

    /* Dynamic Price Amounts */
    #subtotal-amount,
    #discount-amount,
    #total-amount {
        color: inherit !important;
    }

    /* Trust Signals Section - Remove border, let it breathe */
    .ss_trust_signals {
        background-color: transparent !important;
        border-bottom: none !important;
    }

    .ss_trust_signals .text-size-small,
    .ss_trust_signals .text-size-tiny-3 {
        color: #e5e7eb !important; /* Gray-200 - brighter and clearer */
    }

    /* Trust Signals SVG Icons - Modern 2025 with subtle glow */
    .ss_trust_signals svg {
        color: #a5b4fc !important; /* Lighter indigo-300 for better visibility */
        vertical-align: middle !important;
        margin-right: 6px !important;
        display: inline-block !important;
        filter: drop-shadow(0 0 4px rgb(165 180 252 / 30%)) !important;
        transition: all 0.3s ease !important;
    }

    .ss_trust_signals p:hover svg {
        filter: drop-shadow(0 0 6px rgb(165 180 252 / 50%)) !important;
        transform: translateX(2px) !important;
    }

    /* Phone icon - green CTA emphasis with glow */
    .ss_trust_signals p:last-child svg {
        color: #6ee7b7 !important; /* Emerald-300 for better visibility */
        filter: drop-shadow(0 0 6px rgb(110 231 183 / 40%)) !important;
    }

    .ss_trust_signals p:last-child:hover svg {
        filter: drop-shadow(0 0 8px rgb(110 231 183 / 60%)) !important;
    }

    /* Support Section */
    .ss_support_section {
        background-color: transparent !important;
    }

    .ss_support_section .text-size-small {
        color: #e0e0e0 !important; /* Dark text */
    }

    /* Payment Methods Section - Modern 2025 Design with subtle separator */
    .ss_payment_methods {
        background-color: transparent !important;
        border-top: 1px solid rgb(255 255 255 / 6%) !important;
    }

    .ss_payment_methods_label {
        color: rgb(255 255 255 / 60%) !important;
    }

    .ss_payment_icons img {
        opacity: 0.7 !important;
        filter: grayscale(80%) brightness(1.3) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .ss_payment_icons img:hover {
        opacity: 1 !important;
        filter: grayscale(0%) brightness(1.1) !important;
        transform: scale(1.05) !important;
    }

    /* Spacer elements */
    ._1rem-spacer {
        background-color: transparent !important;
    }

    /* ============================================================================
       BUTTON HOVER ANIMATIONS DARK MODE (Issue #270)
       ============================================================================
       Comprehensive button hover states for customer collection page.
       Provides visual feedback on interaction with smooth transitions.

       Button types covered:
       - Primary CTA buttons (submit, continue, etc.)
       - Secondary buttons
       - Link-style buttons
       - Form submit buttons

       Design principles:
       - Smooth 0.2s transitions for all state changes
       - Hover state brightens or shifts background
       - Focus states maintain WCAG 2.2 compliance
       - Active states provide tactile feedback
       ============================================================================ */

    /* Customer Collection Page - Primary Submit Button */
    #submit-checkout-btn,
    .button.w-button,
    input[type="submit"].button {
        background-color: #f0f0f0 !important;
        color: #121212 !important; /* Dark bg */
        border: 2px solid #f0f0f0 !important;
        transition: all 0.2s ease !important;
        cursor: pointer !important;
    }

    #submit-checkout-btn:hover,
    .button.w-button:hover,
    input[type="submit"].button:hover {
        background-color: transparent !important;
        color: #f0f0f0 !important;
        border-color: #f0f0f0 !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgb(0 0 0 / 30%) !important;
    }

    #submit-checkout-btn:active,
    .button.w-button:active,
    input[type="submit"].button:active {
        transform: translateY(0) !important;
        box-shadow: 0 2px 4px rgb(0 0 0 / 20%) !important;
    }

    /* Focus state for keyboard navigation - WCAG 2.2 compliance */
    #submit-checkout-btn:focus,
    .button.w-button:focus,
    input[type="submit"].button:focus {
        outline: 2px solid #5C81FF !important; /* Brand blue */
        outline-offset: 2px !important;
    }

    /* Disabled state */
    #submit-checkout-btn:disabled,
    .button.w-button:disabled,
    input[type="submit"].button:disabled {
        background-color: #333 !important; /* Dark input disabled bg */
        color: #aaa !important; /* Dark input disabled text */
        border-color: #555 !important; /* Dark border */
        cursor: not-allowed !important;
        opacity: 0.6 !important;
        transform: none !important;
        box-shadow: none !important;
    }

    /* Secondary Buttons */
    .button.secondary,
    .button.secondary-3 {
        background-color: transparent !important;
        color: #e0e0e0 !important; /* Dark text */
        border: 2px solid #555 !important; /* Dark border */
        transition: all 0.2s ease !important;
    }

    .button.secondary:hover,
    .button.secondary-3:hover {
        background-color: rgb(255 255 255 / 5%) !important;
        color: #f0f0f0 !important; /* Dark headings */
        border-color: #f0f0f0 !important;
        transform: translateY(-1px) !important;
    }

    .button.secondary:active,
    .button.secondary-3:active {
        transform: translateY(0) !important;
    }

    /* Link-style Buttons */
    a.button,
    .button-link {
        color: #9db4ff !important; /* Dark links */
        text-decoration: none !important;
        transition: all 0.2s ease !important;
        border-bottom: 1px solid transparent !important;
    }

    a.button:hover,
    .button-link:hover {
        color: #c5d7ff !important; /* Dark links hover */
        border-bottom-color: #c5d7ff !important;
    }

    /* Generic Button Hover Override for All Other Buttons */
    button:not([class*="w-"]),
    input[type="button"],
    input[type="reset"] {
        transition: all 0.2s ease !important;
    }

    button:not([class*="w-"]):hover,
    input[type="button"]:hover,
    input[type="reset"]:hover {
        filter: brightness(1.1) !important;
        transform: translateY(-1px) !important;
    }

    button:not([class*="w-"]):active,
    input[type="button"]:active,
    input[type="reset"]:active {
        transform: translateY(0) !important;
    }

    /* ============================================================================
       PAYMENT ICON LIGHT/DARK MODE SWITCHING
       ============================================================================ */

    /* Hide light mode payment icons in dark mode */
    .ss_payment_icon_light {
        display: none !important;
    }

    /* Show dark mode payment icons */
    .ss_payment_icon_dark {
        display: inline-block !important;
    }
}
