/**
 * Weekly Menu Feature Styles
 * CSS styling for weekly menu rights display and cart integration
 * Updated for Phase 5 Task 2 - Order History & Dashboard Integration
 */

/* ========================================================================
   ORDER HISTORY COMBO INTEGRATION - Phase 5 Task 2
   ======================================================================== */

.order-card.has-combo {
    border-left: 4px solid #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #f0fff4 100%);
}

.combo-savings-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.combo-savings-badge::before {
    content: "💰";
    font-size: 0.9rem;
}

.order-item.combo-item {
    background: linear-gradient(135deg, #e8f5e9 0%, #d4edda 100%);
    border-left: 3px solid #28a745;
    position: relative;
}

.order-item.combo-item::before {
    content: "🎁";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1rem;
    opacity: 0.7;
}

.combo-savings-note {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
    margin-top: 4px;
}

.original-price {
    color: #6c757d;
    text-decoration: line-through;
    font-size: 0.9rem;
}

.combo-price {
    color: #28a745;
    font-weight: bold;
    font-size: 1.1rem;
}

.combo-indicator {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Weekly Menu Dashboard Specific Styles */
.weekly-dashboard-container {
    background: #f8f9fa;
    min-height: calc(100vh - 200px);
}

.dashboard-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.rights-grid .right-item {
    transition: all 0.2s ease;
}

.rights-grid .right-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.right-item.expiring-soon {
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { 
        background: #fff8e1;
        border-left-color: #ffc107;
    }
    50% { 
        background: #fff3cd;
        border-left-color: #fd7e14;
    }
}

.right-item.expired {
    filter: grayscale(30%);
}

/* Touch enhancements for mobile */
.touch-device .action-btn,
.touch-device .refresh-btn {
    transition: transform 0.1s ease, background-color 0.2s ease;
}

.touch-device .action-btn:active,
.touch-device .refresh-btn:active {
    transform: scale(0.98);
}

/* ========================================================================
   CART ITEM COMBO STYLING - Phase 4 Task 2 Enhancement
   ======================================================================== */

.cart-item-row.combo-eligible {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.cart-item-row.combo-eligible::before {
    content: "🎁";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cart-combo-indicator {
    background: #28a745;
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-item-pricing {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.cart-item-original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.85rem;
}

.cart-item-combo-price {
    color: #28a745;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-item-price.combo-price {
    color: #28a745;
    font-weight: 700;
    background: rgba(40, 167, 69, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Regular cart items styling for consistency */
.cart-item-row:not(.combo-eligible) {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

/* Enhanced cart item layout */
.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cart-item-name {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .cart-item-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cart-item-actions {
        justify-content: space-between;
        width: 100%;
    }
    
    .cart-combo-indicator {
        margin-left: 0;
        margin-top: 0.25rem;
        align-self: flex-start;
    }
}

/* ========================================================================
   WEEKLY MENU RIGHTS STATUS SECTION
   ======================================================================== */

.weekly-menu-status {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.rights-summary h3 {
    color: #28a745;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
}

.rights-summary h3:before {
    content: "🎁";
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.rights-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

#available-rights-count {
    font-weight: 700;
    color: #28a745;
    font-size: 1.1rem;
}

.savings-amount {
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ========================================================================
   RIGHTS APPLICATION SUMMARY SECTION
   ======================================================================== */

.rights-application-summary {
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.rights-breakdown h4 {
    color: #5a5c69;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e3e6f0;
}

.combo-items-list h5,
.regular-items-list h5 {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 1rem 0 0.75rem 0;
}

/* ========================================================================
   COMBO ITEMS DISPLAY
   ======================================================================== */

.combo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    position: relative;
}

.combo-item .item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.combo-item .item-name {
    font-weight: 500;
    color: #155724;
}

.combo-badge {
    background: #28a745;
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.combo-item .item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.combo-item .original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.85rem;
}

.combo-item .combo-price {
    color: #28a745;
    font-weight: 700;
    font-size: 1rem;
}

/* ========================================================================
   REGULAR ITEMS DISPLAY
   ======================================================================== */

.regular-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.regular-item .item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.regular-item .item-name {
    font-weight: 500;
    color: #495057;
}

.regular-item .quantity {
    color: #6c757d;
    font-size: 0.9rem;
}

.regular-item .item-price {
    font-weight: 600;
    color: #495057;
}

/* ========================================================================
   CART TOTALS SECTION
   ======================================================================== */

.cart-totals {
    background: #fff;
    border: 2px solid #e3e6f0;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.cart-totals > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.subtotal-row {
    border-bottom: 1px solid #e3e6f0;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
}

.savings-row {
    color: #28a745;
    font-weight: 600;
    border-bottom: 1px solid #e3e6f0;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
}

.savings-row .savings-amount {
    background: none;
    color: #28a745;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.total-row {
    font-size: 1.1rem;
    padding-top: 0.75rem;
    border-top: 2px solid #5a5c69;
}

.total-row span {
    font-weight: 700 !important;
}

/* ========================================================================
   MOBILE-FIRST RESPONSIVE DESIGN - PHASE 4 OPTIMIZATION
   ======================================================================== */

/* Base styles are mobile-first (320px+) */

/* Small phones (320px - 480px) */
@media (max-width: 480px) {
    /* Container and spacing adjustments */
    .weekly-menu-status,
    .rights-application-summary,
    .cart-totals {
        padding: 0.875rem; /* Slightly less padding for small screens */
        margin-bottom: 1rem;
        border-radius: 6px; /* Smaller border radius for mobile */
    }
    
    /* Typography adjustments for mobile readability */
    .rights-summary h3 {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    .rights-info {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    /* Combo badge adjustments */
    .combo-badge,
    .cart-combo-indicator {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        border-radius: 8px;
    }
    
    /* Cart item adjustments for very small screens */
    .cart-item-row {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .cart-item-info {
        margin-bottom: 0.5rem;
    }
    
    .cart-item-name {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 0.25rem;
    }
    
    /* Pricing display stacking */
    .cart-item-pricing {
        gap: 0.125rem;
    }
    
    .cart-item-original-price,
    .cart-item-combo-price {
        font-size: 0.8rem;
    }
    
    /* Button adjustments */
    .cart-qty-controls {
        gap: 0.5rem;
        align-items: center;
    }
    
    .cart-qty-btn {
        min-width: 32px;
        min-height: 32px; /* iOS recommended minimum touch target */
        font-size: 0.9rem;
        border-radius: 4px;
    }
    
    .cart-remove-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        min-height: 32px;
    }
    
    /* Rights summary compacting */
    .combo-items-list h5,
    .regular-items-list h5 {
        font-size: 0.85rem;
        margin: 0.75rem 0 0.5rem 0;
    }
}

/* Medium phones and small tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .rights-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    /* Cart items remain horizontal but with better spacing */
    .combo-item,
    .regular-item {
        padding: 0.875rem;
        gap: 0.75rem;
    }
    
    .combo-item .item-info,
    .regular-item .item-info {
        flex: 1;
        min-width: 0; /* Allow text truncation */
    }
    
    .combo-item .item-price,
    .regular-item .item-price {
        flex-shrink: 0;
        text-align: right;
    }
    
    .cart-totals > div {
        padding: 0.625rem 0;
    }
}

/* Tablets and small laptops (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .rights-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    .weekly-menu-status,
    .rights-application-summary,
    .cart-totals {
        padding: 1.125rem;
    }
}

/* Touch-friendly enhancements for all mobile devices */
@media (max-width: 768px) {
    /* Ensure all interactive elements meet touch target guidelines */
    .cart-qty-btn,
    .cart-remove-btn {
        min-width: 44px;
        min-height: 44px; /* iOS and Android recommended minimum */
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        transition: background-color 0.2s ease;
    }
    
    .cart-qty-btn:hover,
    .cart-qty-btn:focus {
        background-color: rgba(0, 123, 255, 0.1);
    }
    
    .cart-remove-btn:hover,
    .cart-remove-btn:focus {
        background-color: rgba(220, 53, 69, 0.1);
    }
    
    /* Better spacing for touch */
    .cart-item-actions {
        gap: 0.75rem;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        padding-top: 0.5rem;
    }
    
    /* Stack cart items vertically on mobile for better readability */
    .cart-item-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .cart-item-row .cart-item-actions {
        justify-content: space-between;
        align-items: center;
        width: 100%;
        flex-wrap: nowrap;
    }
    
    .cart-item-price {
        font-size: 1.1rem;
        font-weight: 700;
        color: #007bff;
    }
    
    .cart-item-price.combo-price {
        color: #28a745;
    }
    
    /* Better visual hierarchy for combo items on mobile */
    .cart-item-row.combo-eligible {
        border-width: 2px;
        box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
    }
    
    .cart-combo-indicator {
        display: inline-block;
        margin-top: 0.25rem;
        align-self: flex-start;
    }
    
    /* Loading state improvements for mobile */
    .rights-loading {
        padding: 1.5rem;
        font-size: 0.9rem;
    }
    
    .rights-loading:before {
        width: 18px;
        height: 18px;
        margin-right: 0.5rem;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .weekly-menu-status,
    .rights-application-summary,
    .cart-totals {
        padding: 0.75rem;
        margin-bottom: 0.875rem;
    }
    
    .rights-summary h3 {
        font-size: 0.9rem;
    }
}

/* High-DPI display adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .combo-badge,
    .cart-combo-indicator,
    .savings-amount {
        /* Ensure crisp text rendering on high-DPI screens */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Mobile-optimized component layouts */
.combo-item.mobile-optimized,
.regular-item.mobile-optimized {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.combo-item.mobile-optimized .item-info,
.regular-item.mobile-optimized .item-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.combo-item.mobile-optimized .item-details,
.regular-item.mobile-optimized .item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mobile-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-pricing .original-price,
.mobile-pricing .combo-price {
    font-size: 0.9rem;
}

/* Progressive Web App enhancements for mobile */
@media (display-mode: standalone) {
    /* PWA-specific styles */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .weekly-menu-status,
    .rights-application-summary,
    .cart-totals {
        margin-left: env(safe-area-inset-left, 0);
        margin-right: env(safe-area-inset-right, 0);
    }
}

/* ========================================================================
   RESPONSIVE DESIGN - LEGACY (MAINTAINED FOR COMPATIBILITY)
   ======================================================================== */

/* ========================================================================
   LOADING AND ANIMATION STATES
   ======================================================================== */

.rights-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

.rights-loading:before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    margin-right: 0.75rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rights-fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================================================
   ERROR STATES
   ======================================================================== */

.rights-error {
    background: #f8d7da;
    border: 1px solid #f1aeb5;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #721c24;
    font-size: 0.9rem;
    margin: 1rem 0;
}

.rights-error:before {
    content: "⚠️";
    margin-right: 0.5rem;
}

/* ========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================================================== */

.combo-badge,
.savings-amount {
    /* Ensure sufficient contrast for accessibility */
    text-shadow: none;
    font-weight: 600;
}

/* Focus states for interactive elements */
.cart-totals:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .combo-item {
        background: #fff;
        border: 2px solid #28a745;
    }
    
    .regular-item {
        background: #fff;
        border: 2px solid #6c757d;
    }
    
    .weekly-menu-status {
        background: #fff;
        border: 2px solid #28a745;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .rights-fade-in,
    .rights-loading:before {
        animation: none;
    }
}

/* ========================================================================
   PHASE 4: CHECKOUT VALIDATION STYLES - Mobile-First Design
   ======================================================================== */

/* Combo savings card in order success page */
.combo-savings-card {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745 !important;
    border-radius: 8px;
    position: relative;
}

.combo-savings-card .info-icon {
    color: #28a745;
}

.combo-savings-card .savings-amount {
    color: #155724;
    font-weight: 700;
    font-size: 1.1rem;
}

.combo-savings-card .text-success {
    color: #28a745 !important;
    font-weight: 500;
}

/* Checkout error states for rights validation */
.rights-validation-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.rights-validation-error::before {
    content: "❌";
    margin-right: 0.5rem;
}

/* Success notification enhancements for combo savings */
.notification.success .combo-savings {
    font-weight: 600;
    color: #155724;
    display: block;
    margin-top: 0.5rem;
}

/* Mobile-specific checkout enhancements */
@media (max-width: 768px) {
    .combo-savings-card {
        margin: 0.75rem 0;
    }
    
    .combo-savings-card .info-content {
        padding: 0.75rem;
    }
    
    .combo-savings-card .savings-amount {
        font-size: 1rem;
    }
    
    /* Ensure rights validation errors are clearly visible on mobile */
    .rights-validation-error {
        padding: 0.875rem;
        font-size: 0.85rem;
        margin: 0.75rem 0;
    }
    
    /* Mobile notification adjustments */
    .notification.success {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .notification.success .combo-savings {
        font-size: 0.85rem;
        margin-top: 0.375rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .combo-savings-card .info-content h4 {
        font-size: 0.9rem;
    }
    
    .combo-savings-card .savings-amount {
        font-size: 0.95rem;
    }
    
    .rights-validation-error {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* ========================================================================
   WEEKLY MENU DASHBOARD STYLING - Phase 5 Task 1
   ======================================================================== */

/* Weekly Rights Summary */
.weekly-rights-summary {
    margin-bottom: 1.5rem;
}

.rights-overview {
    display: flex;
    gap: 2rem;
    justify-content: space-around;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #2196f3;
}

.rights-count, .rights-savings {
    text-align: center;
    flex: 1;
}

.count-number, .savings-amount {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 0.25rem;
}

.count-label, .savings-label {
    display: block;
    font-size: 0.85rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Rights by Expiry */
.rights-by-expiry {
    margin-bottom: 1.5rem;
}

.rights-by-expiry h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.expiry-group {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.expiry-group:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.expiry-group.active {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #f8f9fa 100%);
}

.expiry-group.expiring-soon {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #f8f9fa 100%);
}

.expiry-group.expired {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f8f9fa 100%);
    opacity: 0.7;
}

.expiry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.expiry-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.expiry-icon {
    font-size: 1.25rem;
}

.expiry-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.expiry-details .rights-count {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.expiry-details .expiry-date {
    font-size: 0.85rem;
    color: #666;
}

.expiry-details .expiry-countdown {
    font-size: 0.75rem;
    color: #888;
}

.expiry-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.expiry-status.active {
    background: #28a745;
    color: white;
}

.expiry-status.expiring_soon {
    background: #ffc107;
    color: #212529;
}

.expiry-status.expired {
    background: #dc3545;
    color: white;
}

/* Recent Purchases */
.recent-purchases {
    margin-bottom: 1.5rem;
}

.recent-purchases h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.purchase-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.purchase-item:hover {
    background: #e9ecef;
}

.purchase-item.active {
    border-left: 4px solid #28a745;
}

.purchase-item.expired {
    opacity: 0.6;
    border-left: 4px solid #dc3545;
}

.purchase-info {
    flex: 1;
}

.purchase-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.purchase-details {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #666;
}

.purchase-status {
    text-align: right;
}

.purchase-price {
    display: block;
    font-weight: 600;
    color: #28a745;
    margin-bottom: 0.125rem;
}

.expires-date {
    font-size: 0.75rem;
    color: #888;
}

/* No Rights Message */
.no-rights-message {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.no-rights-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-rights-message h3 {
    color: #333;
    margin-bottom: 1rem;
}

.no-rights-message p {
    color: #666;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.no-rights-benefits {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.benefit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #555;
}

.benefit-icon {
    font-size: 1.1rem;
}

.purchase-cta {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.purchase-cta:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Usage Tip */
.usage-tip {
    background: linear-gradient(135deg, #e1f5fe 0%, #f0f9ff 100%);
    border: 1px solid #0288d1;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.tip-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tip-content {
    flex: 1;
}

.tip-content strong {
    color: #0277bd;
    display: block;
    margin-bottom: 0.25rem;
}

.tip-content p {
    margin: 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem 1rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-message p {
    margin-bottom: 1rem;
}

/* Mobile Responsiveness for Dashboard */
@media (max-width: 768px) {
    .rights-overview {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .count-number, .savings-amount {
        font-size: 1.5rem;
    }
    
    .expiry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.875rem;
    }
    
    .expiry-info {
        width: 100%;
    }
    
    .expiry-status {
        align-self: flex-end;
    }
    
    .purchase-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .purchase-status {
        align-self: flex-end;
        text-align: right;
    }
    
    .purchase-details {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .no-rights-benefits {
        gap: 0.5rem;
    }
    
    .usage-tip {
        padding: 0.875rem;
    }
    
    .tip-content p {
        font-size: 0.85rem;
    }
}

/* Extra small mobile devices - Dashboard */
@media (max-width: 480px) {
    .rights-overview {
        padding: 0.875rem;
    }
    
    .count-number, .savings-amount {
        font-size: 1.25rem;
    }
    
    .count-label, .savings-label {
        font-size: 0.75rem;
    }
    
    .expiry-header {
        padding: 0.75rem;
    }
    
    .expiry-details .rights-count {
        font-size: 0.9rem;
    }
}

/* ========================================================================
   ENHANCED MOBILE TOUCH INTERACTIONS - Phase 5 Task 3 Completion
   ======================================================================== */

/* Touch-friendly enhancements for all clickable elements */
.touch-device .order-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.touch-device .order-card:active {
    transform: scale(0.995);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.touch-device .expiry-group:active {
    transform: scale(0.99);
}

.touch-device .purchase-item:active {
    background: #dee2e6 !important;
    transform: scale(0.99);
}

/* Enhanced touch targets for mobile */
.touch-device .order-actions .btn-action {
    min-height: 44px;
    padding: 0.5rem 1rem;
    margin: 0.125rem;
    font-size: 0.9rem;
}

.touch-device .quick-actions .action-btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0;
    font-weight: 500;
}

/* Mobile-specific order history enhancements */
@media (max-width: 768px) {
    .order-card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .order-header {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .order-total-section {
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .combo-savings {
        flex-shrink: 0;
    }
    
    .order-details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .detail-item {
        background: #f8f9fa;
        padding: 0.5rem;
        border-radius: 4px;
    }
    
    .detail-label {
        font-size: 0.75rem;
        color: #6c757d;
        font-weight: 500;
        text-transform: uppercase;
        margin-bottom: 0.125rem;
    }
    
    .detail-value {
        font-weight: 600;
        color: #333;
        font-size: 0.85rem;
    }
    
    .items-list {
        gap: 0.5rem;
    }
    
    .order-item {
        padding: 0.75rem;
        border-radius: 6px;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .order-item .item-image {
        width: 100%;
        height: 120px;
        border-radius: 4px;
        overflow: hidden;
        margin-bottom: 0.5rem;
    }
    
    .order-item .item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .order-item .item-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .order-item .item-name {
        font-size: 0.9rem;
        font-weight: 600;
        line-height: 1.3;
    }
    
    .order-item .item-quantity {
        font-size: 0.8rem;
        color: #6c757d;
    }
    
    .order-item .combo-savings-note {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        border-radius: 10px;
        display: inline-block;
        width: fit-content;
    }
    
    .order-item .item-price {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.125rem;
        margin-top: 0.25rem;
    }
    
    .order-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: stretch;
        padding: 1rem;
    }
    
    .order-actions .btn-action {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        text-align: center;
        justify-content: center;
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.85rem;
        padding: 0.625rem 0.5rem;
    }
}

/* Extra mobile optimizations for very small screens */
@media (max-width: 480px) {
    .order-details-grid {
        grid-template-columns: 1fr;
    }
    
    .order-actions .btn-action {
        min-width: 100%;
        margin-bottom: 0.375rem;
    }
    
    .order-item .item-image {
        height: 100px;
    }
    
    .combo-savings {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Landscape orientation for mobile devices */
@media (max-width: 768px) and (orientation: landscape) {
    .order-details-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .order-actions {
        padding: 0.75rem 1rem;
    }
    
    .order-actions .btn-action {
        min-width: calc(33.333% - 0.33rem);
        font-size: 0.8rem;
        padding: 0.5rem 0.375rem;
    }
}

/* Dark mode support for mobile users */
@media (prefers-color-scheme: dark) {
    .order-card.has-combo {
        background: linear-gradient(135deg, #1a332a 0%, #2d5a3d 100%);
        color: #e8f5e9;
    }
    
    .combo-savings {
        background: #28a745;
        color: white;
    }
    
    .order-item.combo-item {
        background: linear-gradient(135deg, #1e3a21 0%, #2d5a3d 100%);
        border-left-color: #40c566;
    }
    
    .detail-item {
        background: #2d3238;
        color: #e9ecef;
    }
    
    .detail-label {
        color: #adb5bd;
    }
    
    .detail-value {
        color: #e9ecef;
    }
}

/* ========================================================================
   CART PAGE - HIDDEN ELEMENTS UTILITY CLASSES
   ======================================================================== */

/* Initially hidden elements that are shown via JavaScript */
.weekly-menu-status.hidden,
.rights-loading.hidden,
.rights-application-summary.hidden,
.savings-row.hidden {
    display: none;
}

/* Weekly Menu Dashboard - Inline Style Replacement */

/* Always visible usage tip above packages */
.usage-tip-always-visible {
    background: linear-gradient(135deg, #e1f5fe 0%, #f0f9ff 100%);
    border: 1px solid #0288d1;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.usage-tip-always-visible .tip-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.usage-tip-always-visible .tip-content {
    flex: 1;
}

.usage-tip-always-visible .tip-content strong {
    color: #0277bd;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.usage-tip-always-visible .tip-content p {
    margin: 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Mobile adjustments for always visible tip */
@media (max-width: 768px) {
    .usage-tip-always-visible {
        padding: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .usage-tip-always-visible .tip-content p {
        font-size: 0.85rem;
    }
}

/* Simplified no active rights message */
.no-active-rights-simple {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    color: #6c757d;
    font-style: italic;
}

.collapsible-section {
    margin-top: 2rem;
    border-top: 2px solid #e9ecef;
    padding-top: 1.5rem;
}

.section-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.section-toggle:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.section-toggle h3 {
    margin: 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.section-toggle button {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.section-toggle button:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.section-toggle button:active {
    transform: scale(0.98);
}

/* Toggle text styling (replaces button) */
.toggle-text {
    background: #007bff;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    border: none;
    user-select: none;
}

.toggle-text:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.toggle-text:active {
    transform: scale(0.98);
}

/* Address modal specific overrides - remove blue styling */
#address-modal .toggle-text,
.address-primary-toggle .toggle-text,
.add-address-btn.toggle-text {
    background: transparent;
    color: #495057;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
}

#address-modal .toggle-text:hover,
.address-primary-toggle .toggle-text:hover,
.add-address-btn.toggle-text:hover {
    background: #f8f9fa;
    color: #495057;
    border-color: #adb5bd;
    transform: none;
}

#address-modal .toggle-text:active,
.address-primary-toggle .toggle-text:active,
.add-address-btn.toggle-text:active {
    background: #e9ecef;
    transform: none;
}

/* Address management button overrides - ensure proper styling */
.edit-address-btn,
.set-primary-btn,
.delete-address-btn,
.add-address-btn {
    background: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.8rem !important;
    border-radius: 4px !important;
    font-weight: normal !important;
    text-transform: none !important;
    user-select: none !important;
}

.edit-address-btn:hover,
.set-primary-btn:hover,
.add-address-btn:hover {
    background: #e9ecef !important;
    color: #495057 !important;
    border-color: #adb5bd !important;
    transform: none !important;
}

.delete-address-btn {
    background: #f8d7da !important;
    color: #721c24 !important;
    border-color: #f5c6cb !important;
}

.delete-address-btn:hover {
    background: #f1aeb5 !important;
    color: #721c24 !important;
    border-color: #e85e6c !important;
}

/* Rights summary in toggle header */
.rights-summary-inline {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Responsive adjustments for collapsible section */
@media (max-width: 768px) {
    .collapsible-section {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    .section-toggle {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.875rem;
    }
    
    .section-toggle h3 {
        text-align: center;
        font-size: 1rem;
    }
    
    .section-toggle button {
        align-self: center;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .section-toggle {
        padding: 0.75rem;
    }
    
    .section-toggle h3 {
        font-size: 0.95rem;
    }
    
    .section-toggle button {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

.usage-tip {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #666;
}