/* CSS Variables - Use Elementor primary color with fallback */
:root {
    --mm-primary-color: var(--e-global-color-primary, #6e8946);
    --mm-primary-light: var(--e-global-color-primary-light, #e8f5e9);
    --mm-primary-lighter: var(--e-global-color-primary-lighter, #f1f8f4);
    --mm-primary-dark: var(--e-global-color-primary-dark, #5a7038);
}

/* Utility class for primary color text */
.mm-primary-text {
    color: var(--e-global-color-primary, #6e8946) !important;
}

/* Prevent flickering during transitions */
.move-meat-container {
    position: relative;
    overflow: hidden;
}

/* Remove transitions for instant switching */
#move-meat-delivery-wrapper,
#move-meat-collection-wrapper {
    /* No transitions - instant switching for better performance */
}

/* Section title styling */
.mm-section-title {
    color: var(--e-global-color-primary, #6e8946) !important;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

/* Main section heading */
.mm-main-heading {
    margin: 10px 0;
    font-size: 1.7rem;
}

/* Mobile tap text */
.mobile-tap-text {
    display: none;
    font-size: 0.9em;
    color: #666;
    margin-top: -5px;
    margin-bottom: 15px;
    text-align: center;
}

/* Christmas notice styling */
.mm-christmas-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin: 0 0 20px 0;
    border-radius: 4px;
}

.mm-christmas-cart-notice {
    margin-top: 10px;
    padding: 12px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.mm-christmas-cart-info {
    background: #fff3cd;
    border-top: 3px solid #ffc107;
    margin-bottom: 20px;
}

/* Christmas item badge in mini cart */
.mm-christmas-badge {
    color: #d97706;
    font-weight: 600;
}

/* Christmas date text */
.mm-christmas-date-text {
    color: #d97706;
}

/* Collection date options container */
.collection-date-options {
    margin: 10px 0;
}

.collection-date-options-title {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95em;
}

/* Button styling with primary color */
.mm-btn-primary {
    background-color: var(--e-global-color-primary, #6e8946) !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    border: none !important;
    margin-right: 8px !important;
}

.mm-btn-primary:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.mm-btn-secondary {
    background-color: transparent !important;
    color: var(--e-global-color-primary, #6e8946) !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    border: 2px solid var(--e-global-color-primary, #6e8946) !important;
}

.mm-btn-secondary:hover {
    background-color: var(--mm-primary-dark) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
    border-color: var(--mm-primary-dark) !important;
}

/* Styles for the move-meat container at the top of checkout */
.move-meat-container {
    margin-bottom: 30px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    clear: both;
}

/* Section title styles */
.move-meat-section-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
}

/* Confirmation banner styles */
.move-meat-confirmation-banner {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.confirmation-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.confirmation-icon {
    background-color: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.confirmation-text {
    font-weight: 500;
    font-size: 1.1em;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ensure the container appears at the top of the checkout page and spans full width */
.woocommerce-checkout .col2-set {
    margin-top: 20px;
}

/* Force the container to span full width on desktop */
.woocommerce-checkout form.checkout .move-meat-container {
    width: 100%;
    float: none;
    clear: both;
    margin-left: 0;
    margin-right: 0;
}

/* Clean iOS-style toggle slider */
.move-meat-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 25px auto;
    width: 100%;
    max-width: 400px;
    background: #e9ecef;
    border-radius: 50px;
    padding: 4px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.move-meat-toggle input[type="radio"] {
    display: none;
}

.move-meat-toggle label {
    flex: 1;
    padding: 14px 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 600;
    color: #6c757d;
    position: relative;
    z-index: 2;
    border-radius: 46px;
}

.move-meat-toggle label:hover {
    color: #495057;
}

.move-meat-toggle input[type="radio"]:checked + label {
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Sliding background pill */
.move-meat-toggle:before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--e-global-color-primary, #6e8946);
    border-radius: 46px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.move-meat-toggle:has(input[value="collection"]:checked):before {
    transform: translateX(calc(100% + 4px));
}

/* Selection indicator styles */
.selection-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--e-global-color-primary, #6e8946);
    opacity: 0;
    transition: all 0.3s ease;
}

.move-meat-toggle input[type="radio"]:checked + label .selection-indicator {
    opacity: 1;
    background-color: var(--e-global-color-primary, #6e8946);
}

.move-meat-toggle input[type="radio"]:checked + label .selection-indicator:after {
    content: "✓";
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.move-meat-toggle .method-title {
    font-size: 1.2em;
    font-weight: bold;
}

.move-meat-toggle .method-description {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Improve the grid layout for delivery and collection options */
.move-meat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

/* Selected option styles for delivery dates and collection points */
.move-meat-card {
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.move-meat-card:has(input[type="radio"]:checked) {
    border-color: var(--e-global-color-primary, #6e8946);
}

.move-meat-card input[type="radio"]:checked + .move-meat-card-content {
    background-color: #fff;
}

.move-meat-card input[type="radio"]:checked + .move-meat-card-content:before {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--e-global-color-primary, #6e8946);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: checkmarkPop 0.3s ease;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Multi-schedule market cards */
.market-multi-schedule {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s ease;
}

.market-multi-schedule:hover {
    border-color: var(--e-global-color-primary, #6e8946);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.market-multi-schedule .move-meat-card-content {
    padding: 15px;
}

.collection-date-option {
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
}

.collection-date-option:hover {
    background: var(--mm-primary-light) !important;
    border-color: var(--mm-primary-lighter);
}

.collection-date-option:has(input[type="radio"]:checked) {
    background: #fff !important;
    border-color: var(--e-global-color-primary, #6e8946) !important;
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 2px var(--e-global-color-primary, #6e8946);
}

.collection-date-option input[type="radio"]:checked {
    accent-color: var(--e-global-color-primary, #6e8946);
}

.collection-date-option input[type="radio"]:checked ~ strong {
    color: var(--e-global-color-primary, #6e8946);
    font-weight: 700;
}

/* Add checkmark badge for selected collection date */
.collection-date-option:has(input[type="radio"]:checked):after {
    content: "✓";
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background-color: var(--e-global-color-primary, #6e8946);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: checkmarkPop 0.3s ease;
}

/* Christmas collection option styling */
.christmas-collection-option {
    background: #fff3cd !important;
    border-color: #ffc107;
}

.christmas-collection-option:hover {
    background: #ffe8a1 !important;
    border-color: #ff9800;
}

.christmas-collection-option:has(input[type="radio"]:checked) {
    background: #ffd54f !important;
    border-color: #ff9800 !important;
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.4), 0 0 0 2px #ff9800;
}

.christmas-collection-option:has(input[type="radio"]:checked):after {
    background-color: #ff9800;
}

/* Christmas delivery option styling */
.christmas-delivery-option {
    background: #fff3cd;
    border-color: #ffc107;
}

.christmas-delivery-option:hover {
    background: #ffe8a1;
    border-color: #ff9800;
}

.christmas-delivery-option .move-meat-card-content {
    background: transparent;
}

.move-meat-card input[type="radio"]:checked.christmas-delivery-option + .move-meat-card-content,
.christmas-delivery-option:has(input[type="radio"]:checked) .move-meat-card-content {
    background: #ffd54f;
    border-color: #ff9800;
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(255, 152, 0, 0.4), 0 0 0 3px #ff9800;
}

.christmas-delivery-option input[type="radio"]:checked + .move-meat-card-content:before {
    background-color: #ff9800;
}

@media (max-width: 768px) {
    .move-meat-grid {
        grid-template-columns: 1fr;
    }
    
    .move-meat-toggle {
        max-width: 100%;
        margin: 20px auto;
    }
    
    .move-meat-toggle label {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .mobile-tap-text {
        display: block !important;
    }
    
    /* Sticky confirmation banner for mobile */
    .move-meat-confirmation-banner {
        position: sticky;
        top: 0;
        z-index: 100;
        margin-top: -20px;
        margin-bottom: 20px;
        border-radius: 0;
    }
    
    /* Multi-schedule responsive */
    .market-multi-schedule .move-meat-card-content {
        padding: 12px;
    }
}

/* Fix for notice message links on all devices */
body.e-wc-message-notice .woocommerce-message,
body.e-wc-message-notice .wc-block-components-notice-banner.is-success {
    position: relative;
    z-index: 99999;
    pointer-events: auto;
    touch-action: manipulation;
    margin: 20px 0;
    padding: 15px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.e-wc-message-notice .woocommerce-message a,
body.e-wc-message-notice .wc-block-components-notice-banner.is-success a {
    position: relative;
    z-index: 100000;
    display: inline-block;
    padding: 8px 12px;
    margin: 4px 0;
    pointer-events: auto;
    cursor: pointer;
    text-decoration: underline;
    font-weight: bold;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
}

/* Ensure no other elements are blocking the links */
body.e-wc-message-notice .woocommerce-message::before,
body.e-wc-message-notice .wc-block-components-notice-banner.is-success::before {
    pointer-events: none;
    touch-action: none;
}

/* Add a transparent overlay to ensure clicks reach the links */
body.e-wc-message-notice .woocommerce-message::after,
body.e-wc-message-notice .wc-block-components-notice-banner.is-success::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    pointer-events: none;
    touch-action: none;
}

@media (max-width: 768px) {
    body.e-wc-message-notice .woocommerce-message,
    body.e-wc-message-notice .wc-block-components-notice-banner.is-success {
        padding: 12px;
        margin: 10px 0;
    }

    body.e-wc-message-notice .woocommerce-message a {
        margin: 8px 0;
        background: rgba(255,255,255,0.95);
        border-radius: 4px;
        position: relative;
        z-index: 1000000;
    }
}

