/**
 * Premium Order Now Menu Button & Branch Selection Popup Styles
 * 
 * Brand-matched design for Pradip Sweets & Savouries
 * Elegant, calm, trustworthy visual tone with warm gold/beige accents
 */

/* ============================================
   Brand Color Variables
   ============================================ */
:root {
    --brand-maroon: #cdb27a;
    --brand-maroon-dark: #cdb27a;
    --brand-maroon-hover: #cdb27a;
    --brand-gold: #cdb27a;
    --brand-gold-light: #E8DCC6;
    --brand-cream: #F5F1E8;
    --brand-cream-light: #FAF8F3;
    --brand-brown: #2C2416;
    --brand-brown-light: #3D3428;
    --brand-text: #2C2416;
    --brand-text-light: #5A4F3F;
}

/* ============================================
   Order Now Menu Button Styles
   ============================================ */

   .bwp-navigation ul {
    margin-left: 15px;
    display: flex;
    align-items: center;
}

.order-now-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--brand-gold) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 7px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none !important;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: 0 2px 4px rgba(139, 21, 56, 0.15);
    align-self: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.order-now-button:hover,
.order-now-button:focus {
    background-color: var(--brand-gold) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 21, 56, 0.25);
}

.order-now-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(139, 21, 56, 0.2);
}

/* Mobile menu button styling - Hide button inside menu, show outside */
@media (max-width: 768px) {
    /* Header mobile margin bottom */
    .header-mobile {
        margin-bottom: 20px !important;
    }
    
    /* BWP image margin top */
    .bwp-image {
        margin-top: 20px !important;
    }
    
    /* Hide the button inside the mobile menu */
    .menu-item-order-now {
        display: none !important;
    }
    
    /* Hide regular button in mobile menu */
    nav .order-now-button,
    .bwp-navigation .order-now-button,
    .menu .order-now-button {
        display: none !important;
    }
    
    /* Create button outside menu - fixed at bottom of screen */
    .order-now-button-mobile {
        position: fixed !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 999998 !important;
        display: block !important;
        width: calc(100% - 40px) !important;
        max-width: 400px !important;
        padding: 14px 24px !important;
        background-color: var(--brand-gold) !important;
        color: #ffffff !important;
        text-decoration: none !important;
        border-radius: 0 !important;
        font-weight: 600 !important;
        font-size: 15px !important;
        text-align: center !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
        transition: all 0.3s ease !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
        box-sizing: border-box !important;
        border: none !important;
        margin: 0 !important;
    }
    
    .order-now-button-mobile:hover,
    .order-now-button-mobile:focus,
    .order-now-button-mobile:active {
        background-color: var(--brand-gold) !important;
        color: #ffffff !important;
        text-decoration: none !important;
        transform: translateX(-50%) translateY(-2px) !important;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25) !important;
    }
    
    /* Alternative: Position in header area if inside header */
    .site-header .order-now-button-mobile,
    header .order-now-button-mobile,
    .header .order-now-button-mobile {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px 0 !important;
        display: block !important;
    }
    
    /* Ensure button is visible above other content */
    body .order-now-button-mobile {
        position: fixed !important;
    }
}

/* ============================================
   Popup Modal Styles
   ============================================ */

.order-now-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

.order-now-popup.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Overlay background - soft dark with optional blur */
.order-now-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    cursor: pointer;
}

/* Popup content container - cream background, elegant styling */
.order-now-popup-content {
    position: relative;
    background-color: var(--brand-cream-light);
    border-radius: 11px;
    padding: 45px 40px;
    max-width: 720px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(44, 36, 22, 0.15);
    z-index: 1;
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.order-now-popup.active .order-now-popup-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}


/* Close button - minimal, elegant */
.order-now-popup-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--brand-text-light);
    cursor: pointer;
    padding: 8px;
    transition: all 0.25s ease;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 300;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 36px;
    min-height: 36px;
}

.order-now-popup-close:hover,
.order-now-popup-close:focus {
    color: var(--brand-maroon);
    background-color: rgba(139, 21, 56, 0.08);
    outline: none;
}

.order-now-popup-close span {
    display: block;
    line-height: 1;
}

/* Popup title - dark brown, elegant typography */
.order-now-popup-title {
    margin: 0 0 35px 0;
    font-size: 28px;
    font-weight: 600;
    color: var(--brand-brown);
    text-align: center;
    padding-right: 40px;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

/* Branches container - side-by-side on desktop */
.order-now-branches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 10px;
}

/* Branch card - white background, gold-tinted border */
.order-now-branch-card {
    background-color: #ffffff;
    border: 1.5px solid var(--brand-gold-light);
    border-radius: 10px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(44, 36, 22, 0.06);
}

.order-now-branch-card:hover {
    border-color: var(--brand-gold);
    box-shadow: 0 6px 20px rgba(44, 36, 22, 0.12);
    transform: translateY(-2px);
}

/* Branch name - dark brown, medium-large font */
.branch-name {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--brand-brown);
    letter-spacing: -0.2px;
    line-height: 1.3;
}

/* Branch subtext - optional descriptive text */
.branch-subtext {
    margin: 0 0 24px 0;
    font-size: 14px;
    font-weight: 400;
    color: var(--brand-text-light);
    line-height: 1.5;
    opacity: 0.8;
}

/* Branch button - deep maroon, inside card */
.branch-button {
    display: inline-block;
    padding: 13px 28px;
    background-color: var(--brand-gold);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-transform: none;
    letter-spacing: 0;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(139, 21, 56, 0.15);
}

.branch-button:hover,
.branch-button:focus {
    background-color: var(--brand-gold);
    color: #ffffff !important;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(139, 21, 56, 0.25);
}

.branch-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(139, 21, 56, 0.2);
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 768px) {
    .order-now-popup {
        padding: 10px;
    }
    
    .order-now-popup-content {
        padding: 32px 20px;
        width: calc(100% - 20px);
        max-width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 12px;
        margin: 10px;
    }
    
    .order-now-popup-title {
        font-size: 22px;
        margin-bottom: 24px;
        padding-right: 35px;
        line-height: 1.4;
    }
    
    .order-now-branches {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-top: 8px;
    }
    
    .order-now-branch-card {
        padding: 26px 18px;
    }
    
    .branch-name {
        font-size: 19px;
        margin-bottom: 10px;
    }
    
    .branch-subtext {
        font-size: 13px;
        margin-bottom: 18px;
    }
    
    .branch-button {
        padding: 14px 22px;
        font-size: 14px;
    }
    
    .order-now-popup-close {
        top: 10px;
        right: 10px;
        font-size: 28px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .order-now-popup {
        padding: 5px;
    }
    
    .order-now-popup-content {
        padding: 28px 18px;
        width: calc(100% - 10px);
        max-width: 100%;
        max-height: calc(100vh - 10px);
        border-radius: 12px;
        margin: 5px;
    }
    
    .order-now-popup-title {
        font-size: 20px;
        padding-right: 30px;
        margin-bottom: 20px;
        line-height: 1.3;
    }
    
    .order-now-branches {
        gap: 16px;
    }
    
    .order-now-branch-card {
        padding: 22px 16px;
    }
    
    .branch-name {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .branch-subtext {
        font-size: 12px;
        margin-bottom: 16px;
    }
    
    .branch-button {
        padding: 13px 20px;
        font-size: 13px;
    }
    
    .order-now-popup-close {
        top: 8px;
        right: 8px;
        font-size: 26px;
        width: 38px;
        height: 38px;
    }
}

/* ============================================
   Accessibility
   ============================================ */

.order-now-popup[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.order-now-popup[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Focus styles for keyboard navigation - brand maroon */
.order-now-button:focus,
.branch-button:focus,
.order-now-popup-close:focus {
    outline: none;
}

/* Prevent body scroll when popup is open */
body.order-now-popup-open {
    overflow: hidden;
}

/* Hide mobile button when popup is open */
body.order-now-popup-open .order-now-button-mobile {
    display: none !important;
}

/* Smooth scrollbar styling for popup content */
.order-now-popup-content::-webkit-scrollbar {
    width: 8px;
}

.order-now-popup-content::-webkit-scrollbar-track {
    background: var(--brand-cream);
    border-radius: 4px;
}

.order-now-popup-content::-webkit-scrollbar-thumb {
    background: var(--brand-gold);
    border-radius: 4px;
}

.order-now-popup-content::-webkit-scrollbar-thumb:hover {
    background: var(--brand-gold-light);
}
