/**
 * Weekly Menu System Styles
 * Blissful Bellies - astra-child
 */

/* Main container */
.bb-weekly-menus-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 10px;
    background: #fff7ca;
    font-family: 'Larsseit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Empty state */
.bb-weekly-menus-empty {
    text-align: center;
    padding: 40px 15px;
    background: #fff7ca;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bb-weekly-menus-empty p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Weekly section */
.bb-weekly-section {
    margin-bottom: 15px;
}

.bb-weekly-section:last-child {
    margin-bottom: 0;
}

/* Week header */
.bb-week-header {
    display: block;
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #fff7ca;
    line-height: 32px;
}

.bb-week-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 0;
    font-family: 'Larsseit', sans-serif;
    line-height: inherit;
    display: inline;
    vertical-align: -25%;
}

/* Responsive date formats */
.bb-week-dates-full {
    display: inline; /* Show on desktop/tablet */
}

.bb-week-dates-compact {
    display: none; /* Hide on desktop/tablet */
}

.bb-week-status {
    background: #a87abb;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    display: inline-block;
    vertical-align: -25%;
    margin-right: 12px;
}

/* Menu tiles container */
.bb-menu-tiles-container {
    position: relative;
    border-radius: 8px;
    background: #fff7ca;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bb-menu-tiles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 6px;
    max-width: 1320px;
    margin: 0 auto;
}


/* Menu tile */
.bb-menu-tile {
    background: #f6ecff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.bb-menu-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: #CB6CE6;
}

.bb-menu-tile.bb-tile-expired {
    opacity: 0.6;
    cursor: not-allowed;
}

.bb-menu-tile.bb-tile-expired:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

/* Sold Out Tile Styling */
.bb-menu-tile.bb-tile-sold-out {
    opacity: 0.7;
    position: relative;
    cursor: not-allowed;
}

.bb-menu-tile.bb-tile-sold-out::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 16px;
    z-index: 1;
    pointer-events: none;
}

.bb-menu-tile.bb-tile-sold-out:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #dc3545;
}


/* Sold Out Button */
.bb-tile-add-to-cart.bb-tile-sold-out-button {
    background: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed !important;
    color: white !important;
}

.bb-tile-add-to-cart.bb-tile-sold-out-button:hover {
    background: #6c757d !important;
    border-color: #6c757d !important;
    transform: none !important;
}

/* Tile image */
.bb-tile-image {
    width: 100%;
    height: 300px; /* Reduced height for wider appearance */
    overflow: hidden;
    position: relative;
    margin: 0;
    /* Image extends to edge of tile */
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
    border: none !important;
    outline: none !important;
}

.bb-tile-image:hover,
.bb-tile-image:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.bb-tile-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    background: #f6ecff;
    transition: none;
    margin: 0;
    padding: 0;
    display: block;
    border-radius: 16px 16px 0 0;
    border: none;
    outline: none;
    transform: scale(1.25); /* Zoom in 25% to crop edges and focus on center */
    transform-origin: center center;
}

.bb-tile-image img:hover,
.bb-tile-image img:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Removed image hover effect to prevent double outlines */

.bb-tile-placeholder-image {
    width: 100%;
    height: 100%;
    background: #f6ecff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    margin: 0;
    padding: 0;
}

.bb-tile-placeholder-image::before {
    content: "📸";
    font-size: 32px;
}

/* Tile content */
.bb-tile-content {
    padding: 8px 12px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: #f6ecff;
    gap: 7px;
}

h3.bb-tile-title,
.bb-menu-tile .bb-tile-title,
.bb-tile-content .bb-tile-title {
    font-size: 18px !important;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.3;
    font-family: 'Larsseit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Remove old bb-tile-date as it's now handled by date-time-pickers */

.bb-tile-price {
    font-size: 20px;
    font-weight: 700;
    color: #CB6CE6;
    margin: 0 0 8px 0;
}

/* Countdown timer */
.bb-tile-countdown {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 8px;
    font-size: 12px;
}

.bb-countdown-text {
    display: block;
    color: #856404;
    font-weight: 500;
    margin-bottom: 2px;
}

.bb-countdown-timer {
    display: block;
    color: #d63384;
    font-weight: 700;
    font-size: 14px;
}

/* Tile actions - anchored with date/time pickers */
.bb-tile-actions {
    padding: 8px 12px 12px 12px;
    display: flex;
    flex-direction: column;
    background: #f6ecff;
    gap: 8px;
}

/* Date and Time pickers inline - anchored above button */
.bb-tile-date-time-pickers {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(203, 108, 230, 0.05);
    border: 1px solid rgba(203, 108, 230, 0.15);
    border-radius: 6px 6px 0 0; /* Connect to button below */
    margin: 0;
    position: relative;
    overflow: hidden; /* Prevent overflow */
}

/* Create subtle connection line between picker and button */
.bb-tile-date-time-pickers::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(203, 108, 230, 0.15);
}

.bb-date-label {
    padding: 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    background: transparent;
    white-space: nowrap;
    flex-shrink: 0; /* Don't shrink the date label */
    margin-right: 8px;
}

.bb-time-select {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 11px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
    flex: 1;
    min-width: 0;
    box-sizing: border-box; /* Include padding in width */
}

.bb-time-select:focus {
    outline: none;
    border-color: #CB6CE6;
    box-shadow: 0 0 0 2px rgba(203, 108, 230, 0.2);
}

.bb-time-select:hover {
    border-color: #CB6CE6;
}

.bb-time-select.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.bb-time-select.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* Sold out message styling */
.bb-sold-out-message {
    padding: 8px 12px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    display: block;
}

.bb-tile-view-button,
.bb-tile-add-to-cart {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: 'Larsseit', sans-serif;
}

.bb-tile-view-button {
    background: transparent;
    color: #CB6CE6;
    border: 2px solid #CB6CE6;
}

.bb-tile-view-button:hover {
    background: #CB6CE6;
    color: white;
    text-decoration: none;
}

.bb-tile-add-to-cart {
    background: #CB6CE6;
    color: white;
    border: 2px solid #CB6CE6;
    border-radius: 0 0 6px 6px; /* Connect to picker above */
    margin-top: -1px; /* Overlap with picker connection line */
}

.bb-tile-add-to-cart:hover {
    background: #a87abb;
    border-color: #a87abb;
}

.bb-tile-add-to-cart:disabled,
.bb-tile-expired .bb-tile-add-to-cart {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.bb-tile-add-to-cart.loading {
    position: relative;
    color: transparent;
}

.bb-tile-add-to-cart.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: bb-spin 1s linear infinite;
}

@keyframes bb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .bb-weekly-menus-container {
        padding: 8px 0;
        margin: 0 -4px;
    }
    
    .bb-week-header {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        margin-bottom: 8px;
        padding: 6px 10px;
    }
    
    .bb-week-title {
        font-size: 20px;
    }
    
    
    .bb-menu-tiles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
        max-width: 900px;
    }


    .bb-tile-image {
        height: 300px; /* Reduced height for wider appearance */
    }

    .bb-tile-content {
        padding: 8px 12px;
        gap: 5px;
    }
    
    h3.bb-tile-title,
    .bb-menu-tile .bb-tile-title,
    .bb-tile-content .bb-tile-title {
        font-size: 14px !important;
    }
    
    .bb-tile-actions {
        padding: 0 12px 12px 12px;
    }
}

@media (max-width: 480px) {
    /* Show compact date format on mobile */
    .bb-week-dates-full {
        display: none;
    }

    .bb-week-dates-compact {
        display: inline;
    }

    .bb-menu-tiles-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
        max-width: 400px;
    }


    .bb-tile-image {
        height: 250px; /* Reduced height for wider appearance */
    }

    .bb-tile-content {
        padding: 4px 8px;
        gap: 2px;
    }
    
    h3.bb-tile-title,
    .bb-menu-tile .bb-tile-title,
    .bb-tile-content .bb-tile-title {
        font-size: 13px !important;
        line-height: 1.2;
    }
    
    
    .bb-sold-out-message {
        font-size: 10px;
        padding: 6px 8px;
    }
    
    .bb-tile-price {
        font-size: 12px;
    }
    
    .bb-tile-date-time-pickers {
        flex-direction: row;
        gap: 0;
        align-items: center;
        justify-content: space-between;
        padding: 6px 8px;
        background: rgba(203, 108, 230, 0.05);
        border: 1px solid rgba(203, 108, 230, 0.15);
        border-radius: 4px;
        overflow: hidden; /* Prevent overflow */
    }

    .bb-date-label {
        text-align: center !important; /* Center the date text */
        padding: 0;
        font-size: 12px;
        margin-right: 4px;
        flex: 1 !important; /* Take remaining space on the left */
        white-space: nowrap;
        display: block !important;
    }

    .bb-time-select {
        padding: 4px 6px;
        font-size: 10px;
        flex-shrink: 0 !important; /* Don't shrink the time select */
        flex-grow: 0 !important;
        flex-basis: auto !important;
        width: 180px !important; /* Fixed width */
        height: 28px;
        line-height: 1.2;
        box-sizing: border-box; /* Include padding in width */
    }
    
    .bb-tile-actions {
        padding: 8px 10px 10px 10px;
        gap: 6px;
    }
    
    .bb-scroll-button {
        display: none;
    }
}

/* Touch interactions */
@media (hover: none) and (pointer: coarse) {
    .bb-menu-tile:hover {
        transform: none;
    }
    
    .bb-menu-tile:active {
        transform: scale(0.98);
    }
}

/* Focus states for accessibility */
.bb-menu-tile:focus,
.bb-tile-view-button:focus,
.bb-tile-add-to-cart:focus {
    outline: 3px solid #CB6CE6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bb-menu-tile {
        border: 2px solid #333;
    }
    
    .bb-tile-title,
    .bb-tile-date {
        color: #000;
    }
    
    .bb-week-status {
        background: #000;
        color: #fff;
    }
}

/* Single Product Date/Time Picker - Now handled by unified styling below */
/*
.woocommerce.single-product .bb-single-product-datetime-picker {
    margin: 15px 0;
    padding: 15px;
    background: #f6ecff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    clear: both;
    display: block;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}
*/

/* Single product uses same styling as menu tiles */
.woocommerce.single-product .bb-single-product-datetime-picker .bb-tile-date-time-pickers {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
}

/* Ensure all datetime picker elements maintain consistent styling */
.woocommerce.single-product .bb-single-product-datetime-picker .bb-pickup-delivery-label,
.woocommerce.single-product .bb-single-product-datetime-picker .bb-date-label {
    color: #666;
    font-weight: 500;
}

.woocommerce.single-product .bb-single-product-datetime-picker .bb-time-select {
    background: white;
    border: 1px solid #ddd;
    min-width: 150px;
}

/* Ensure proper spacing after the entire picker */
.woocommerce.single-product .bb-single-product-datetime-picker + * {
    margin-top: 30px;
}

/* Style for the pickup/delivery label */
.bb-pickup-delivery-label {
    font-weight: 500;
    color: #666;
    margin-right: 4px;
    white-space: nowrap;
}

.bb-date-select,
.bb-single-product-datetime-picker .bb-time-select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.bb-date-select {
    width: 100%;
}

/* Make time picker narrower for single product page */
.woocommerce.single-product .bb-single-product-datetime-picker .bb-time-select {
    width: 200px;
    flex-shrink: 0;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
    height: 36px;
    line-height: 1.4;
    padding: 8px 12px;
    box-sizing: border-box;
}

.bb-date-select:focus,
.bb-single-product-datetime-picker .bb-time-select:focus {
    outline: none;
    border-color: #CB6CE6;
    box-shadow: 0 0 0 2px rgba(203, 108, 230, 0.2);
}

.bb-date-select.error,
.bb-single-product-datetime-picker .bb-time-select.error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
    border-width: 2px !important;
}

/* Enhanced mobile error styling for better visibility */
@media (max-width: 768px) {
    .bb-date-select.error,
    .bb-single-product-datetime-picker .bb-time-select.error {
        border-width: 3px !important;
        border-color: #dc3545 !important;
        background-color: #fff5f5 !important;
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
        transform: scale(1.02);
        transition: all 0.3s ease;
    }
    
    .bb-date-select.error:focus,
    .bb-single-product-datetime-picker .bb-time-select.error:focus {
        box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.25) !important;
        outline: none;
    }
}

.bb-error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 4px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .woocommerce.single-product .bb-single-product-datetime-picker {
        margin: 15px 0 20px 0;
        padding: 15px;
        background: #f6ecff;
        border-radius: 8px;
        border: 1px solid #e0e0e0;
    }
    
    .woocommerce.single-product .bb-single-product-datetime-picker .bb-tile-date-time-pickers {
        margin-bottom: 15px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    /* Pickup/delivery label takes full width (first line) */
    .woocommerce.single-product .bb-single-product-datetime-picker .bb-pickup-delivery-label {
        width: 100%;
        margin-right: 0;
        flex-basis: 100%;
    }

    /* Date label and time select share second line */
    .woocommerce.single-product .bb-single-product-datetime-picker .bb-date-label {
        flex-shrink: 0;
        margin-right: 8px;
    }

    /* Time picker takes remaining space on second line */
    .woocommerce.single-product .bb-single-product-datetime-picker .bb-time-select {
        width: 180px;
        flex-shrink: 0;
        flex-grow: 0;
        margin: 0;
        height: 36px;
        padding: 8px 12px;
        line-height: 1.4;
        font-size: 14px;
    }
    
    /* Increase date picker font size on mobile */
    .woocommerce.single-product .bb-single-product-datetime-picker .bb-date-select,
    .woocommerce.single-product .bb-date-select,
    .woocommerce.single-product .bb-single-product-datetime-picker .bb-date-label {
        font-size: 16px !important;
    }
    
    .woocommerce.single-product .cart {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-top: 20px;
    }
    
    .woocommerce.single-product .cart .quantity {
        justify-content: center;
        margin-right: 0;
    }
    
    .woocommerce.single-product .cart .quantity input[type="number"] {
        width: 80px;
        height: 44px;
        font-size: 16px;
        -webkit-appearance: auto;
        -moz-appearance: auto;
        appearance: auto;
    }
    
    .woocommerce.single-product .cart button[type="submit"] {
        margin-left: 0;
    }
}

/* Scroll buttons and notification styles */
.bb-scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(203, 108, 230, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bb-scroll-button:hover {
    background: rgba(168, 122, 187, 1);
    transform: translateY(-50%) scale(1.1);
}

.bb-scroll-button.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.bb-scroll-left {
    left: 10px;
}

.bb-scroll-right {
    right: 10px;
}

.bb-countdown-urgent {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.bb-countdown-urgent .bb-countdown-text {
    color: #721c24;
}

/* Lazy loading image optimization */
.bb-lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.bb-lazy-image.loaded,
.bb-lazy-image[loading="eager"] {
    opacity: 1;
}

.bb-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.bb-notification.show {
    transform: translateX(0);
}

.bb-notification-success {
    background: #CB6CE6;
}

.bb-notification-error {
    background: #CB6CE6;
}

/* ==============================================
   MODIFIER STYLES - BASE (Works in all contexts)
   ============================================== */

/* Base modifier container - works everywhere */
.bb-product-modifiers {
    margin: 10px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 50px;
}

/* Ensure styling applies even when empty */
.bb-product-modifiers:empty {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    min-height: 50px;
}

.bb-product-modifiers h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    font-family: 'Larsseit', sans-serif;
}

/* Base modifier list styles */
.bb-modifier-list {
    margin-bottom: 8px;           /* reduced spacing between inner boxes */
    display: block;
    width: 100%;
}

.bb-modifier-list:last-child {
    margin-bottom: 0;
}

.bb-modifier-list h5 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    font-family: 'Larsseit', sans-serif;
    display: block;
    background: #f9f9f9;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Base modifier option styles */
.bb-modifier-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    clear: both;
    float: none;
    min-height: 50px;
}

.bb-modifier-option:hover {
    border-color: #CB6CE6;
    background: #f8f4ff;
}

/* Modifier info section (name + price) */
.bb-modifier-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-right: 20px;
    align-items: flex-start;
}

/* Quantity control section */
.bb-modifier-quantity-control {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 36px;
}

.bb-quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #CB6CE6;
    background: #fff;
    color: #CB6CE6;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.bb-quantity-btn:hover {
    background: #CB6CE6;
    color: #fff;
}

.bb-quantity-btn:active {
    transform: scale(0.95);
}

/* Modifier quantity styles moved to components/modifiers.css */

.bb-modifier-name {
    flex-grow: 1;
    font-size: 12px;
    color: #333;
    margin: 0;
    padding: 0;
    font-family: 'Larsseit', sans-serif;
}

.bb-modifier-price {
    font-size: 14px;
    font-weight: 600;
    color: #CB6CE6;
    flex-shrink: 0;
    margin-left: 10px;
}

/* No modifiers container styling - ensure consistent appearance */
.bb-modifier-list.bb-no-modifiers {
    min-height: 30px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    padding: 10px;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.bb-no-modifier-placeholder {
    height: 10px;
    display: block;
    background: transparent;
    margin: 0;
    padding: 0;
}

/* ==============================================
   SINGLE PRODUCT CONTEXT - Specific Overrides
   ============================================== */

/* Reduce margin between price and modifiers on single product page */
.woocommerce.single-product .bb-product-modifiers {
    margin-top: 5px;
    margin-bottom: 15px;
}

/* ==============================================
   RESPONSIVE MODIFIER STYLES
   ============================================== */

/* Responsive modifier styles - Base (works everywhere) */
@media (max-width: 768px) {
    .bb-product-modifiers {
        padding: 12px;
    }
    
    .bb-product-modifiers h4 {
        font-size: 16px;
    }
    
    .bb-modifier-list h5 {
        font-size: 14px;
    }
    
    .bb-modifier-option {
        padding: 8px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-height: 60px;
    }
    
    .bb-modifier-info {
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .bb-modifier-quantity-control {
        justify-content: flex-end;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .bb-quantity-btn {
        width: 40px;
        height: 36px;
        font-size: 18px;
    }
    
    /* Mobile modifier quantity styles moved to components/modifiers.css */
    
    .bb-modifier-name,
    .bb-modifier-price {
        font-size: 12px;
    }
    
    .bb-modifier-list.bb-no-modifiers {
        min-height: 15px;
        padding: 8px;
    }
    
    /* Single product specific mobile adjustments */
    .woocommerce.single-product .bb-product-modifiers {
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .bb-product-modifiers {
        margin: 10px 0;
        padding: 12px;
    }
    
    .bb-modifier-total {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

/* ==============================================
   ADD TO CART & QUANTITY ALIGNMENT FIX
   ============================================== */

/* 2. Cart form spacing and layout */
.woocommerce.single-product .cart {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px !important;  /* consistent spacing */
    clear: both;
    width: 100%;
}

.woocommerce.single-product .cart .quantity {
    margin: 0;
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.woocommerce.single-product .cart .quantity input[type="number"] {
    width: 60px;
    height: 40px;
    text-align: center;
    margin: 0;
    -webkit-appearance: auto;
    -moz-appearance: textfield;
    appearance: auto;
}

.woocommerce.single-product .cart button[type="submit"] {
    height: 40px;
    margin: 0;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Force cart form to appear below all product elements */
.woocommerce.single-product .product .summary {
    display: flex;
    flex-direction: column;
}

.woocommerce.single-product .product .summary .cart {
    order: 999;
    display: block;
    width: 100%;
    clear: both;
    float: none;
}

/* Old float and spacing rules - now handled by unified styling below */

/*=============================================================================
  UNIFIED SINGLE‐PRODUCT PICKER & MODIFIERS STYLING
  — always apply the same box, spacing & background
=============================================================================*/

/* 1. Always show the same purple-tinted box around both picker & modifiers */
.woocommerce.single-product .bb-single-product-datetime-picker,
.woocommerce.single-product .bb-product-modifiers {
  display: block;
  clear: both;
  width: 100%;
  background: #f6ecff;          /* same lilac background */
  border: 1px solid #e0e0e0;    /* same border */
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 35px;          /* increased gap before the cart */
  box-sizing: border-box;
}

/* 2. If there are no modifiers, still force a placeholder height
   so you don't collapse back up against the cart form: */
.woocommerce.single-product .bb-product-modifiers:empty {
  min-height: 60px;
}

/* 3. Remove any floating/width hacks so everything sits in normal flow */
.woocommerce.single-product .bb-single-product-datetime-picker,
.woocommerce.single-product .bb-product-modifiers {
  float: none !important;
}

/* 4. Cart positioning - consistent 15px spacing */
.woocommerce.single-product .bb-single-product-datetime-picker + .cart,
.woocommerce.single-product .bb-product-modifiers + .cart {
  margin-top: 15px !important;     /* consistent spacing after picker/modifiers */
}

/*—————————————————————
  TIGHTEN UP PRICE → MODIFIERS GAP
—————————————————————*/

/* 1. Shrink the gap under the date/time picker */
.woocommerce.single-product .bb-single-product-datetime-picker {
  /* make the bottom margin smaller (was 25px) */
  margin: 8px 0 8px !important;
}

/* 2. Nix the extra push on the modifiers list */
.woocommerce.single-product .bb-product-modifiers {
  /* default is margin-top: 5px; */
  margin-top: 2px      /* or 0px if you want them flush */  !important;
}

/* ———————————————————————
   TIGHTEN UP BOTTOM OF PICKER + MODIFIERS
   ——————————————————————— */

/* 1) Pull in the purple outer box's bottom padding (default is 15px) */
.woocommerce.single-product .bb-single-product-datetime-picker {
  padding: 15px 15px 10px !important;  /* top/right/left unchanged, bottom to 10px */
}

/* 2) Add bottom margin on the modifiers panel (default is 10px top & bottom) */
.woocommerce.single-product .bb-product-modifiers {
  margin: 10px 0 8px !important;       /* keep the 10px top, add 8px bottom */
}

/* FORCE INCREASED MARGIN BETWEEN DATETIME PICKER AND ADD TO CART - HIGHEST PRIORITY OVERRIDE */
.woocommerce.single-product .bb-single-product-datetime-picker + .cart,
.woocommerce.single-product .bb-single-product-datetime-picker + form.cart {
  margin-top: 50px !important;
}

/* UNIVERSAL MARGIN FIX - TARGET ALL POSSIBLE CART SELECTORS */
.woocommerce.single-product .cart,
.woocommerce.single-product form.cart,
.woocommerce.single-product .single_add_to_cart_button,
.woocommerce.single-product .quantity {
  margin-top: 14px !important;
}

/* ALSO TRY PADDING ON THE DATETIME PICKER BOTTOM */
.woocommerce.single-product .bb-single-product-datetime-picker {
  padding-bottom: 6px !important;
}

/* REDUCE INNER MODIFIER SPACING */
.woocommerce.single-product .bb-product-modifiers {
  padding: 8px !important;
}

.woocommerce.single-product .bb-modifier-list {
  margin-bottom: 5px !important;
}

.woocommerce.single-product .bb-modifier-option {
  margin-bottom: 3px !important;
  padding: 6px 8px !important;
}

/* ==============================================
   BACK LINK ON SINGLE PRODUCT PAGES
   ============================================== */

.bb-single-product-back-container {
    margin-bottom: 25px;
    display: block;
    width: 100%;
    clear: both;
}

/* Increase margin for pantry items to create more space from product image */
.bb-single-product-back-container:has(.bb-back-pantry) {
    margin-bottom: 40px;
}

.bb-back-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0 !important;
    background: transparent !important;
    color: #666 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: 'Larsseit', sans-serif !important;
    transition: all 0.2s ease !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.bb-back-button:hover {
    color: #CB6CE6 !important;
    text-decoration: underline !important;
    transform: translateX(-2px) !important;
    background: transparent !important;
}

.bb-back-button:focus {
    outline: 2px solid #CB6CE6 !important;
    outline-offset: 2px !important;
    border-radius: 2px !important;
    background: transparent !important;
}

/* Mobile styling for back link */
@media (max-width: 768px) {
    .bb-single-product-back-container {
        margin-bottom: 20px;
    }

    .bb-single-product-back-container:has(.bb-back-pantry) {
        margin-bottom: 30px;
    }

    .bb-back-button {
        font-size: 14px !important;
        padding: 8px 0 !important;
        min-height: 36px;
        display: inline-flex !important;
        align-items: center !important;
    }
}