/*
 * Alpine Cart Page CSS
 * Based on Shopify Checkout Desktop Design
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
   :root {
    --alpine-red: #e0192e;
    --alpine-red-hover: #c01729;
    --alpine-dark-text: #1B1B1B;
    --alpine-light-bg: #ffffff;
    --alpine-text-secondary: #666666;
    --alpine-border-color: #e0e0e0;
    --cart-padding: 16px;
    --cart-border-radius: 8px;
    --cart-shadow-light: 0 2px 12px rgba(0, 0, 0, 0.08);
    --cart-input-height: 48px;
    --cart-form-spacing: 16px;
    --cart-max-width: 1200px;
    --cart-gap: 16px;
    --cart-padding: 16px;
    --checkout-padding: 16px;
    
    /* Enhanced popup animations */
    --popup-animation-duration: 0.6s;
    --popup-animation-delay: 0.1s;
    --product-stagger-delay: 0.15s;
    --hover-transform: translateY(-8px) scale(1.02);
    --popup-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    --popup-shadow-hover: 0 35px 100px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Cart Title Section
   ========================================================================== */
.alpine-cart-main-title {
    text-align: center;
    border-radius: var(--checkout-border-radius);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.alpine-cart-main-title h1 {
    margin: 40px 0 12px 0;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.alpine-cart-main-title .cart-subtitle {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

/* Test Popup Button */
.test-popup-button {
    margin-top: 16px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--alpine-red), var(--alpine-red-hover));
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(224, 25, 46, 0.3);
    position: relative;
    z-index: 2;
}

.test-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 25, 46, 0.4);
    background: linear-gradient(135deg, #ff1f3d, #d0162b);
}

.test-popup-button:active {
    transform: translateY(0);
}

.test-popup-button i {
    font-size: 12px;
}

/* ==========================================================================
   Base Cart Layout
   ========================================================================== */
html.alpine-cart-html,
body.alpine-cart-page {
    font-family: 'Alef', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--alpine-dark-text);
    font-size: 16px;
    direction: rtl;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Logo sizing to match checkout */
.alpine-cart-logo img {
    height: 40px;
    width: auto;
}

/* Note: Help section styling defined later in file */

/* Ensure proper flex layout - Match checkout */
.alpine-cart-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.alpine-shopify-checkout-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: var(--cart-max-width, 1200px);
    margin: 0 auto;
    padding: var(--cart-padding, 16px);
    width: 100%;
}

.alpine-checkout-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--cart-gap, 16px);
    align-items: start;
}

.alpine-cart-page #wrapper {
    display: none !important;
}

.alpine-cart-page .site-footer {
    display: none !important;
}

/* ==========================================================================
   Checkout Header Section - Match checkout exactly
   ========================================================================== */
.alpine-checkout-header {
    background-color: var(--alpine-light-bg);
    border-bottom: 1px solid var(--alpine-border-color);
    padding: 9px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.alpine-checkout-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--checkout-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.alpine-checkout-logo {
    flex: 0 0 auto;
}

.alpine-checkout-logo img {
    height: 45px;
    width: auto;
}

.alpine-checkout-security {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--alpine-text-secondary);
    flex: 0 0 auto;
    direction: rtl;
}

.alpine-checkout-security i {
    color: #28a745;
}

/* Enhanced security badge styling to match checkout exactly */
.alpine-checkout-header .alpine-checkout-security {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    padding: 6px 18px;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
}

.alpine-checkout-header .alpine-checkout-security i {
    color: #fff;
    font-size: 16px;
}

/* Progress Bar Fixed Styling */
.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.step-number,
.step-check {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.step-number {
    background: var(--alpine-bg-light, #f8f9fa);
    border: 2px solid var(--alpine-border-color, #e9ecef);
    color: var(--alpine-text-secondary, #6c757d);
}

.step-check {
    background: #28a745;
    border: 2px solid #28a745;
    color: white;
}

.progress-step.current .step-number {
    background: var(--alpine-red, #e0192e);
    border-color: var(--alpine-red, #e0192e);
    color: white;
}

.progress-step.completed .step-number {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.step-label {
    font-size: 14px;
    color: var(--alpine-text-secondary, #6c757d);
    text-align: center;
    white-space: nowrap;
}

.progress-step.current .step-label {
    color: var(--alpine-red, #e0192e);
    font-weight: 600;
}

.progress-step.completed .step-label {
    color: #28a745;
    font-weight: 600;
}

.progress-line {
    width: 60px;
    height: 2px;
    background-color: #e0e0e0;
    margin: 0 16px;
}

.progress-step.completed .step-circle {
    background-color: var(--alpine-red);
    color: white;
}

.progress-step.completed .step-number {
    display: none;
}

.progress-step.completed .step-check {
    display: block;
}

.progress-step.completed .step-label {
    color: var(--alpine-red);
}

.progress-step.active .step-circle {
    background-color: var(--alpine-red);
    color: white;
    box-shadow: 0 0 0 4px rgba(224, 25, 46, 0.2);
}

.progress-step.active .step-label {
    color: var(--alpine-red);
    font-weight: 600;
}

.progress-step.completed + .progress-line {
    background-color: var(--alpine-red);
}

.progress-step.active + .progress-line {
    background: linear-gradient(90deg, var(--alpine-red) 50%, #e0e0e0 50%);
}

.alpine-cart-security {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #28a745;
    font-size: 14px;
    font-weight: 600;
}

.alpine-cart-security i {
    font-size: 16px;
}

/* ==========================================================================
   Main Checkout Layout - Match checkout structure
   ========================================================================== */
.alpine-shopify-checkout-main {
    max-width: var(--cart-max-width, 1200px);
    margin: 0 auto;
    padding: var(--cart-padding, 20px);
    flex: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
}

.alpine-checkout-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--cart-gap, 20px);
    align-items: start;
    flex: 1; /* Take remaining space in main */
}

/* Use checkout column classes */
.alpine-checkout-left-column {
    min-width: 0; /* Prevents overflow */
}

.alpine-checkout-right-column {
    position: sticky;
    top: 85px;
}

/* Cart Section Styling - Use checkout classes */
.alpine-checkout-section {
    background-color: var(--alpine-light-bg);
    padding: var(--cart-padding);
    border-radius: var(--cart-border-radius);
    box-shadow: var(--cart-shadow-light);
    margin-bottom: var(--cart-form-spacing);
}

/* Responsive Grid Layout */
@media (max-width: 1024px) {
    .alpine-checkout-container {
        grid-template-columns: 1fr 350px;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .alpine-checkout-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .alpine-checkout-right-column {
        position: static;
        order: -1; /* Show summary first on mobile */
    }
}

.alpine-cart-page .alpine-cart-left-column,
.alpine-cart-page .alpine-cart-right-column {
    background: transparent;
    max-width: none;
}

.alpine-cart-page form.cart,
.alpine-cart-page .alpine-cart-main,
.alpine-cart-page .alpine-cart-section {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

/* ==========================================================================
   Cart Section Styling
   ========================================================================== */
.alpine-cart-left-column {
    flex: 1;
}

.alpine-cart-section {
    background-color: var(--alpine-light-bg);
    padding: var(--cart-padding);
    border-radius: var(--cart-border-radius);
    box-shadow: var(--cart-shadow-light);
    margin-bottom: var(--cart-form-spacing);
}

.alpine-cart-section h2 {
    margin: 0 0 var(--cart-form-spacing) 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--alpine-dark-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.alpine-cart-section h2 i {
    color: var(--alpine-red);
    font-size: 20px;
}

/* ==========================================================================
   Cart Items Styling
   ========================================================================== */
.alpine-cart-items {
    padding: var(--checkout-padding);
    /* border-bottom: 1px solid var(--alpine-border-color); */
}

.alpine-cart-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: none;
}

.alpine-cart-item:last-child {
    margin-bottom: 0;
    border-bottom: 0;
}

.alpine-cart-item:hover {
    border-color: transparent;
    box-shadow: none;
}

.cart-item-image {
    position: relative;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--alpine-border-color);
}

.alpine-cart-item:hover .cart-item-image img {
    transform: none;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--alpine-dark-text);
}

.cart-item-details p {
    margin: 0;
    font-size: 13px;
    color: var(--alpine-text-secondary);
}

.cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--alpine-dark-text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.cart-item-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cart-item-title a:hover {
    color: var(--alpine-red);
}

.cart-item-price {
    font-size: 13px;
    color: var(--alpine-text-secondary);
    margin-top: 4px;
    text-align: start;
}

.cart-item-total {
    font-weight: 600;
    font-size: 14px;
    color: var(--alpine-dark-text);
}

/* ==========================================================================
   Continue Shopping Button
   ========================================================================== */
.alpine-continue-shopping {
    text-align: center;
    margin-top: 20px;
    display: flex;
    align-items: start;
    flex-direction: row;
}

/* ==========================================================================
   Order Summary (Right Column) - Match checkout exactly
   ========================================================================== */
.alpine-order-summary {
    background-color: var(--alpine-light-bg);
    padding: var(--cart-padding);
    border-radius: var(--cart-border-radius);
    box-shadow: var(--cart-shadow-light);
}

.alpine-order-summary h3 {
    margin: 0 0 var(--cart-form-spacing) 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--alpine-dark-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.alpine-order-summary h3 i {
    color: var(--alpine-red);
    font-size: 18px;
}

/* Discount Section */
.alpine-discount-section {
    margin-bottom: var(--cart-form-spacing);
    padding-bottom: var(--cart-form-spacing);
    border-bottom: 1px solid var(--alpine-border-color);
}

.alpine-discount-input {
    display: flex;
    gap: 0;
    border-radius: 25px;
    overflow: hidden;
    border: 2px solid var(--alpine-border-color);
    transition: border-color 0.3s ease;
}

.alpine-discount-input:focus-within {
    border-color: var(--alpine-red);
}

.alpine-discount-input input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
}

.alpine-discount-input button {
    padding: 12px 20px;
    border: none;
    background: var(--alpine-red);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.alpine-discount-input button:hover {
    background: var(--alpine-red-hover);
}

/* Price Breakdown */
.alpine-price-breakdown {
    margin-bottom: var(--cart-form-spacing);
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
}

.price-line:last-child {
    border-bottom: none;
    margin-top: 8px;
}
span.woocommerce-Price-amount.amount bdi {
    justify-content: end;
}

.price-line.total {
    font-size: 16px;
    font-weight: 700;
    color: var(--alpine-red);
    margin-top: 1px;
    padding-top: 8px;
}

.price-line.discount {
    color: #28a745;
}

.price-line.discount span:last-child {
    color: #28a745;
    font-weight: 600;
}

/* Complete Order Button - Match checkout exactly */
.alpine-complete-order-section {
    margin-bottom: var(--cart-form-spacing);
}

.alpine-complete-order-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--alpine-red), var(--alpine-red-hover));
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 25px rgba(224, 25, 46, 0.3);
}

.alpine-complete-order-btn:hover {
    background: linear-gradient(135deg, #ff1f3d, #d0162b);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(224, 25, 46, 0.4);
    color: white;
    text-decoration: none;
}

.alpine-security-note {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    color: var(--alpine-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.alpine-security-note i {
    color: #28a745;
}

/* Trust Elements */
.alpine-trust-elements {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: var(--cart-form-spacing);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--alpine-text-secondary);
    padding: 8px;
    background: #f9f9f9;
    border-radius: 6px;
    text-align: center;
}

.trust-item i {
    color: #28a745;
    font-size: 14px;
    flex-shrink: 0;
}

/* ==========================================================================
   Applied Coupons
   ========================================================================== */
.applied-coupons {
    margin-top: 12px;
}

.applied-coupon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #155724;
}

.applied-coupon .remove-coupon {
    background: none;
    border: none;
    color: #155724;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}

.applied-coupon .remove-coupon:hover {
    background: #155724;
    color: white;
}

/* ==========================================================================
   Contact Options - Match checkout exactly
   ========================================================================== */
.alpine-checkout-contact-options {
    margin: 30px auto 17vh;
    background: red;
    background-color: var(--alpine-light-bg);
    padding: var(--cart-padding);
    border-radius: var(--cart-border-radius);
    box-shadow: var(--cart-shadow-light);
    /* margin-bottom: var(--cart-form-spacing); */
}

.alpine-checkout-contact-options h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--alpine-dark-text);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    border-bottom: 1px solid #eeeeee9c;
    padding-bottom: 10px;
}

.alpine-checkout-contact-options h4 i {
    color: var(--alpine-red);
    font-size: 18px;
}

.contact-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.contact-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border-radius: 8px;
    text-decoration: none;
    color: var(--alpine-dark-text);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: var(--alpine-font-main, 'Atlas AAA', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    direction: rtl;
    white-space: nowrap;
    min-height: 48px;
    box-shadow: none;
}

.contact-option:hover {
    background: transparent;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: none;
    text-decoration: none;
    color: var(--alpine-red);
}

.contact-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #5b5a5a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.contact-option:hover .contact-icon {
    background: var(--alpine-red);
    color: white;
    transform: scale(1.1);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: start;
    line-height: 1;
}

.contact-label {
    font-size: 13px;
    font-weight: 600;
    color: inherit;
    line-height: 1.1;
}

.contact-value {
    font-size: 12px;
    color: inherit;
    opacity: 0.8;
    line-height: 1.1;
}

/* All contact options use same color */
.contact-option[href*="whatsapp"] .contact-icon,
.contact-option[href*="wa.me"] .contact-icon,
.contact-option[href*="mailto"] .contact-icon {
    background: #5b5a5a;
}

.contact-option[href*="whatsapp"]:hover .contact-icon,
.contact-option[href*="wa.me"]:hover .contact-icon,
.contact-option[href*="mailto"]:hover .contact-icon {
    background: var(--alpine-red);
}

/* ==========================================================================
   Help Section - Match checkout styling
   ========================================================================== */
.alpine-checkout-help {
    margin: 0;
    padding: var(--cart-padding);
    border-top: 1px solid var(--alpine-border-color);
    background: var(--alpine-light-bg);
    margin-top: auto; /* Push to bottom */
    width: 100%;
    max-width: 100%;
}

.alpine-checkout-help p {
    text-align: center;
    margin: 0;
    font-size: 16px;
    color: var(--alpine-text-secondary);
}

.alpine-checkout-help a {
    color: var(--alpine-red);
    text-decoration: none;
    font-weight: 600;
}

.alpine-checkout-help a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Empty Cart State
   ========================================================================== */
.alpine-empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: var(--alpine-light-bg);
    border-radius: var(--cart-border-radius);
    box-shadow: var(--cart-shadow-light);
}

.alpine-empty-cart i {
    font-size: 64px;
    color: var(--alpine-text-secondary);
    margin-bottom: 20px;
    display: block;
}

.alpine-empty-cart h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--alpine-dark-text);
    margin-bottom: 10px;
}

.alpine-empty-cart p {
    font-size: 16px;
    color: var(--alpine-text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

/* ==========================================================================
   Alpine Button Integration
   ========================================================================== */
.alpine-button {
    background: linear-gradient(135deg, #e0192e, #c01729);
    color: #fff;
    padding: 16px 32px;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 160px;
    text-align: center;
    border: 2px solid #e0192e;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
}

.alpine-button:hover {
    background: linear-gradient(135deg, #ff1f3d, #d0162b);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(224, 25, 46, 0.4);
    color: #fff;
    text-decoration: none;
    border-color: transparent;
}

.alpine-button:focus {
    outline: 2px solid rgba(224, 25, 46, 0.5);
    outline-offset: 2px;
}

.alpine-button:active {
    transform: translateY(-1px);
}

.alpine-button.button-outline {
    background: transparent;
    color: var(--alpine-red);
    border-color: var(--alpine-red);
}

.alpine-button.button-outline:hover {
    background: var(--alpine-red);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(224, 25, 46, 0.3);
    text-decoration: none;
}

/* ==========================================================================
   Last Opportunity Popup - Updated to use WooCommerce product template
   ========================================================================== */
.last-opportunity-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.last-opportunity-popup.show {
    display: flex;
    opacity: 1;
    animation: popupFadeIn 0.5s ease-out;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.4s ease-out;
}

.popup-content {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-radius: 20px;
    max-width: 980px;
    width: 100%;
    max-height: -webkit-fill-available;
    scrollbar-width: thin;
    overflow: auto;
    position: relative;
    box-shadow: var(--popup-shadow);
    animation: popupSlideIn var(--popup-animation-duration) cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(224, 25, 46, 0.1);
    transform-style: preserve-3d;
    perspective: 1000px;
    scrollbar-color: #666 transparent;
}

.popup-content:hover {
    /* box-shadow: var(--popup-shadow-hover); */
    /* transform: translateY(-2px); */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.woocommerce.discount-products-wrapper .products:not(.products .products) {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
}
@keyframes popupSlideIn {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.85) rotateX(10deg);
    }
    50% {
        transform: translateY(-5px) scale(1.02) rotateX(-2deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

@keyframes popupFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes overlayFadeIn {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

.popup-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--alpine-red) 0%, #d4142a 50%, var(--alpine-red-hover) 100%);
    color: white;
    position: relative;
    overflow: hidden;
    animation: headerGlow 2s ease-in-out infinite alternate;
    position: sticky;
    top: 0;
    z-index: 2;
}

.popup-header h3 {
    margin: 0;
    font-size: 23px;
    font-weight: 400;
    /* text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); */
    animation: titlePulse 2s ease-in-out infinite;
    position: relative;
    z-index: 2;
    color: white;
}

@keyframes headerGlow {
    0% {
        box-shadow: 0 0 20px rgba(224, 25, 46, 0.3);
    }
    100% {
        box-shadow: 0 0 30px rgba(224, 25, 46, 0.5);
    }
}

@keyframes headerShine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes titlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.popup-close {
    background: transparent;255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    border: 0;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.popup-close:hover {
    /* background: rgba(255, 255, 255, 0.25); */
    border-color: rgba(255, 255, 255, 0.5);
    /* transform: scale(1.15) rotate(90deg); */
    /* box-shadow: 0 0 20px rgba(255, 255, 255, 0.3); */
}

.popup-close:active {
    transform: scale(0.95) rotate(90deg);
}

.popup-body {
    padding: 12px 14px;
    text-align: center;
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    overflow: auto;
    height: -webkit-fill-available;
    max-height: -webkit-fill-available;
}


.popup-body p {
    font-size: 18px;
    color: var(--alpine-text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
    position: relative;
    animation: textFadeIn 0.8s ease-out 0.3s both;
}

@keyframes bodyGlow {
    0%, 100% {
        opacity: 0.6;
        box-shadow: 0 0 10px rgba(224, 25, 46, 0.3);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 20px rgba(224, 25, 46, 0.6);
    }
}

@keyframes textFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Discount Products Grid - Using standard WooCommerce styling */
.discount-products-wrapper {
    max-width: 600px;
    margin: 0 auto 32px;
}

/* No Products Message */
.no-products-message {
    text-align: center;
    color: var(--alpine-text-secondary);
    font-size: 16px;
    margin: 20px 0;
}

.popup-footer {
    padding: 28px 24px;
    border-top: 1px solid rgba(224, 25, 46, 0.1);
    display: flex;
    gap: 20px;
    justify-content: center;
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
    position: relative;
    display: none;
}

.popup-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--alpine-red), transparent);
    border-radius: 1px;
}

.popup-footer .alpine-button {
    flex: 1;
    max-width: 200px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.popup-footer .alpine-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.popup-footer .alpine-button:hover::before {
    left: 100%;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Large Desktop (1441px+) */
@media (min-width: 1441px) {
    .alpine-shopify-checkout-main {
        max-width: 1400px;
        gap: 80px;
    }
    
    .alpine-checkout-right-column {
        width: 400px;
        min-width: 400px;
        max-width: 400px;
    }
}

/* Desktop (1200px - 1440px) */
@media (min-width: 1200px) and (max-width: 1440px) {
    .alpine-shopify-checkout-main {
        max-width: 1200px;
        gap: 60px;
    }
}

/* Tablet (769px - 1199px) */
@media (min-width: 769px) and (max-width: 1199px) {
    .alpine-shopify-checkout-main {
        gap: 40px;
        padding: 30px 20px;
    }
    
    .alpine-checkout-right-column {
        width: 350px;
        min-width: 350px;
        max-width: 350px;
    }
}

/* Mobile (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .alpine-cart-main-title {
        margin-bottom: 16px;
    }
    
    .alpine-cart-main-title h1 {
        font-size: 22px;
    }
    
    .alpine-cart-main-title .cart-subtitle {
        font-size: 13px;
    }
    
    .alpine-shopify-checkout-main {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 24px 16px;
    }
    
    .alpine-checkout-header-content {
        padding: 0 16px;
        flex-direction: column;
        gap: 16px;
    }
    
    .alpine-checkout-logo img {
        height: 35px;
    }
    
    .alpine-checkout-security {
        font-size: 12px;
    }
    
    .alpine-checkout-header .alpine-checkout-security {
        margin-top: 4px;
        font-size: 14px;
        padding: 5px 14px;
    }
    
    .alpine-cart-item {
        grid-template-columns: 80px 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 12px;
        padding: 16px;
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
        grid-row: 1 / 3;
    }
    
    .cart-item-details {
        grid-column: 2;
        grid-row: 1;
    }
    
    .cart-item-total {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
    }
    
    .alpine-trust-elements {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .contact-options-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .discount-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
    .alpine-cart-main-title {
        margin-bottom: 12px;
    }
    
    .alpine-cart-main-title h1 {
        font-size: 20px;
    }
    
    .alpine-cart-main-title .cart-subtitle {
        font-size: 12px;
    }
    
    .alpine-shopify-checkout-main {
        padding: 15px 8px;
        gap: 24px;
    }
    
    .alpine-checkout-header {
        padding: 12px 0;
    }
    
    .alpine-checkout-header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 0 12px;
    }
    
    .alpine-checkout-logo img {
        height: 35px;
    }
    
    .alpine-checkout-security {
        font-size: 12px;
    }
    
    .alpine-checkout-header .alpine-checkout-security {
        margin-top: 4px;
        font-size: 14px;
        padding: 5px 14px;
    }
    
    .alpine-checkout-section {
        padding: 16px;
    }
    
    .alpine-checkout-section h2 {
        font-size: 20px;
    }
    
    .alpine-cart-item {
        gap: 10px;
        padding: 12px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .cart-item-title {
        font-size: 16px;
    }
    

    
    .alpine-complete-order-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .popup-content {
        margin: 10px;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .popup-header,
    .popup-body,
    .popup-footer {
        padding: 16px;
    }
    
    .popup-header h3 {
        font-size: 20px;
    }
    

    
    .popup-footer {
        flex-direction: column;
        gap: 12px;
        padding: 20px 16px;
    }
    
    .popup-footer .alpine-button {
        max-width: none;
    }
    

}

/* Extra Small Mobile (≤320px) */
@media (max-width: 320px) {
    .alpine-checkout-section {
        padding: 12px;
    }
    
    .alpine-checkout-section h2 {
        font-size: 18px;
    }
    
    .alpine-cart-item {
        gap: 8px;
        padding: 10px;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
    }
    
    .cart-item-title {
        font-size: 14px;
    }
    

    
    .alpine-complete-order-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .alpine-checkout-help,
    .last-opportunity-popup {
        display: none;
    }
    
    .alpine-shopify-checkout-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .alpine-order-summary {
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   Critical Layout Fixes
   ========================================================================== */
.alpine-cart-container {
    background: #f8f9fa;
    direction: rtl;
}

.alpine-cart-container * {
    box-sizing: border-box;
}

/* Force show icons */
i[class*="fa-"] {
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
}

/* Ensure proper cart item layout */
.alpine-cart-items {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.alpine-cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 15px 0px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    margin: 0 0 5px;
}

@media (max-width: 768px) {
    .alpine-cart-item {
        grid-template-columns: 80px 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 12px;
        padding: 16px;
    }
    
    .cart-item-image {
        width: 80px !important;
        height: 80px !important;
        grid-row: 1 / 3;
    }
    
    .cart-item-details {
        grid-column: 2;
        grid-row: 1;
    }
    

    
    .cart-item-total {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
    }
} 

/* Mobile responsive styling for help section */
@media (max-width: 768px) {
    .alpine-checkout-help {
        padding: 16px 12px;
    }
    
    .alpine-checkout-help p {
        font-size: 14px;
    }
    
    .contact-options-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .contact-option {
        padding: 10px;
        gap: 8px;
        min-height: 40px;
        font-size: 13px;
    }
    
    .contact-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .contact-details {
        align-items: start;
        gap: 1px;
    }
    
    .contact-label {
        font-size: 12px;
    }
    
    .contact-value {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .alpine-checkout-help {
        padding: 12px 8px;
    }
    
    .alpine-checkout-help p {
        font-size: 13px;
    }
    
    .contact-options-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .contact-option {
        padding: 8px;
        gap: 6px;
        min-height: 36px;
        font-size: 12px;
    }
    
    .contact-icon {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }
    
    .contact-label {
        font-size: 11px;
    }
    
    .contact-value {
        font-size: 10px;
    }
} 

/* Hide brand name overlays from products */
.alpine-brand-name {
    display: none !important;
}

.alpine-brand-logo-overlay.alpine-brand-name-overlay {
    display: none !important;
} 

/* Quantity Controls */
.cart-item-quantity {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--alpine-border-color);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f8f9fa;
    color: var(--alpine-dark-text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--alpine-red);
    color: white;
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 50px;
    height: 32px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--alpine-dark-text);
    background: transparent;
    outline: none;
    padding: 0;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input[type=number] {
    -moz-appearance: textfield;
}

.remove-item {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.remove-item:hover {
    background: #dc3545;
    color: white;
}

.remove-item i {
    font-size: 12px;
}

/* Mobile responsive for quantity controls */
@media (max-width: 768px) {
    .cart-item-quantity {
        margin-top: 8px;
        gap: 8px;
    }
    
    .quantity-controls {
        border-radius: 4px;
    }
    
    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .quantity-input {
        width: 40px;
        height: 28px;
        font-size: 13px;
    }
    
    .remove-item {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Product quantity badge */
.cart-item-image .product-quantity {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--alpine-red);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
} 

/* ==========================================================================
   Cart Loading States and Animations
   ========================================================================== */

/* Loading indicator styles */
#cart-loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 8px;
    z-index: 9999;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#cart-loading-indicator i {
    margin-left: 8px;
}

/* Cart message styles */
#cart-message-container {
    margin: 10px 0;
}

.cart-message {
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
    margin: 10px 0;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.cart-message i {
    margin-left: 8px;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cart item updating states */
.alpine-cart-item.updating {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.alpine-cart-item.updating .quantity-input,
.alpine-cart-item.updating .quantity-btn,
.alpine-cart-item.updating .remove-item {
    opacity: 0.5;
}

/* Quantity input updating state */
.quantity-input.updating {
    background-color: #f8f9fa;
    border-color: #e0192e;
    box-shadow: 0 0 0 2px rgba(224, 25, 46, 0.1);
}

/* Remove button updating state */
.remove-item.updating {
    background-color: #dc3545 !important;
    color: white !important;
    pointer-events: none;
}

/* Apply discount button updating state */
#apply-discount:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Fade out animation for removed items */
.alpine-cart-item.removing {
    animation: fadeOutSlide 0.3s ease-out forwards;
}

@keyframes fadeOutSlide {
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* Success animation for updated items */
.alpine-cart-item.updated {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(40, 167, 69, 0.1);
    }
    100% {
        background-color: transparent;
    }
}

/* Responsive adjustments for loading states */
@media (max-width: 768px) {
    #cart-loading-indicator {
        padding: 16px;
        font-size: 13px;
    }
    
    .cart-message {
        padding: 10px 12px;
        font-size: 13px;
    }
} 

/* ==========================================================================
   Discount Products Grid in Popup - WooCommerce Integration
   ========================================================================== */

/* Ensure WooCommerce product grid styling is applied */
.discount-products-wrapper {
    max-width: 100%;
    margin: 0 auto 32px;
}

.discount-products-wrapper .woocommerce {
    margin: 0;
    padding: 0;
}

/* Quick Add to Cart Button Styling in Popup */
.discount-products-wrapper .products li.product .button,
.discount-products-wrapper .products li.product .add_to_cart_button,
.discount-products-wrapper .products li.product a.button {
    display: block !important;
    width: 100%;
    margin-top: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #e0192e 0%, #c01729 100%);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.discount-products-wrapper .products li.product .button:hover,
.discount-products-wrapper .products li.product .add_to_cart_button:hover,
.discount-products-wrapper .products li.product a.button:hover {
    background: linear-gradient(135deg, #c01729 0%, #a01020 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 25, 46, 0.4);
}

.discount-products-wrapper .products li.product .button.loading,
.discount-products-wrapper .products li.product .add_to_cart_button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.discount-products-wrapper .products li.product .added_to_cart {
    display: block !important;
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    background: #28a745;
    color: #fff !important;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
    text-decoration: none;
}

/* Make product cards in popup more compact */
.discount-products-wrapper .products li.product {
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.discount-products-wrapper .products li.product:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.discount-products-wrapper .products li.product img {
    border-radius: 8px;
    margin-bottom: 8px;
}

.discount-products-wrapper .products li.product .woocommerce-loop-product__title {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 6px;
}

.discount-products-wrapper .products li.product .price {
    font-size: 14px;
    font-weight: 700;
    color: #e0192e;
}
  