/* ============================================================
   MOBILE UX FIXES
   - Footer email text wrapping
   - Sticky checkout bar on mobile
   - Cart confirmation popup
   ============================================================ */

/* ----------------------------------------------------------
   1. FOOTER & HEADER EMAIL TEXT WRAPPING (all screens)
   ---------------------------------------------------------- */
.optech-footer-info a,
.optech-footer-info li,
.optech-footer-textarea a,
.optech-footer-textarea p,
.optech-header-info a,
.optech-header-info li,
.optech-footer-info-wrap a,
.optech-footer-info-wrap li,
.optech-infobox-data h5,
.optech-infobox-data a,
.optech-infobox-item a,
.optech-infobox-item h5 {
    overflow-wrap: break-word;
    word-break: break-word;
    word-wrap: break-word;
    -ms-word-break: break-all;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* Ensure the footer info container is responsive */
@media (max-width: 767px) {
    .optech-footer-info,
    .optech-footer-info ul,
    .optech-footer-info li,
    .optech-footer-textarea,
    .optech-header-info,
    .optech-header-info ul,
    .optech-header-info li,
    .optech-infobox-data,
    .optech-infobox-item,
    .optech-infobox-item a {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .optech-footer-info a,
    .optech-header-info a,
    .optech-infobox-data h5,
    .optech-infobox-item a {
        display: inline-block;
        max-width: 100%;
        font-size: 14px;
    }

    .optech-footer-info li,
    .optech-header-info li {
        display: flex;
        align-items: flex-start;
        gap: 6px;
        flex-wrap: wrap;
    }

    .optech-footer-info li i,
    .optech-header-info li i {
        flex-shrink: 0;
        margin-top: 3px;
    }

    /* Fix the contact info boxes on the homepage (digital_agency) */
    .optech-contact-info-wrap,
    .optech-contact-info-wrap h3,
    .optech-contact-info-wrap a,
    .optech-contact-info-wrap p {
        overflow-wrap: break-word;
        word-break: break-word;
        max-width: 100%;
    }

    /* Fix infobox items (Call/Email/Hours boxes) on IT Solutions homepage */
    .optech-infobox-wrap .optech-infobox-data h5 {
        font-size: 15px;
        line-height: 1.4;
        overflow-wrap: break-word;
        word-break: break-word;
        max-width: 100%;
    }

    .optech-infobox-item {
        padding: 20px 15px !important;
    }

    .optech-infobox-item a {
        overflow-wrap: break-word;
        word-break: break-word;
    }
}


/* ----------------------------------------------------------
   2. STICKY MOBILE CHECKOUT BAR (mobile only)
   ---------------------------------------------------------- */
.mobile-sticky-checkout {
    display: none;
}

@media (max-width: 767px) {
    .mobile-sticky-checkout {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        padding: 10px 16px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-sticky-checkout.is-visible {
        transform: translateY(0);
    }

    .mobile-sticky-checkout__info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .mobile-sticky-checkout__icon {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-sticky-checkout__icon svg {
        width: 26px;
        height: 26px;
    }

    .mobile-sticky-checkout__badge {
        position: absolute;
        top: -6px;
        right: -8px;
        background: #3b5be6;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .mobile-sticky-checkout__label {
        font-size: 13px;
        color: #6b7280;
        font-weight: 500;
    }

    .mobile-sticky-checkout__label strong {
        color: #111827;
        display: block;
        font-size: 14px;
    }

    .mobile-sticky-checkout__btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        background: linear-gradient(135deg, #3b5be6 0%, #2a47c9 100%);
        color: #ffffff !important;
        font-size: 14px;
        font-weight: 600;
        padding: 10px 20px;
        border-radius: 8px;
        border: none;
        text-decoration: none !important;
        white-space: nowrap;
        transition: all 0.25s ease;
        box-shadow: 0 2px 8px rgba(59, 91, 230, 0.35);
    }

    .mobile-sticky-checkout__btn:hover,
    .mobile-sticky-checkout__btn:active {
        background: linear-gradient(135deg, #2a47c9 0%, #1e38a8 100%);
        color: #ffffff !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(59, 91, 230, 0.45);
    }

    .mobile-sticky-checkout__btn i {
        font-size: 16px;
    }

    /* Add bottom spacing to footer so it doesn't get hidden behind the sticky bar */
    .optech-footer-section {
        padding-bottom: 70px !important;
    }
}


/* ----------------------------------------------------------
   3. CART CONFIRMATION POPUP / TOAST
   ---------------------------------------------------------- */
.cart-confirm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 10000;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-confirm-overlay.is-active {
    display: block;
    opacity: 1;
}

.cart-confirm-popup {
    position: fixed;
    z-index: 10001;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.cart-confirm-popup.is-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Desktop/Tablet: top-right toast style */
@media (min-width: 768px) {
    .cart-confirm-popup {
        top: 20px;
        right: 20px;
        width: 380px;
        max-width: calc(100vw - 40px);
    }
}

/* Mobile: center of screen, full width */
@media (max-width: 767px) {
    .cart-confirm-popup {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        width: calc(100vw - 32px);
        max-width: 360px;
    }

    .cart-confirm-popup.is-active {
        transform: translate(-50%, -50%) scale(1);
    }

    /* Stack popup buttons vertically on mobile */
    .cart-confirm-popup__actions {
        flex-direction: column;
        gap: 8px;
        padding: 14px 16px;
    }

    .cart-confirm-popup__btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }
}

.cart-confirm-popup__inner {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.cart-confirm-popup__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
    border-bottom: 1px solid #e5e7eb;
}

.cart-confirm-popup__check {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: cartCheckPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.15s both;
}

@keyframes cartCheckPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.cart-confirm-popup__check svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.cart-confirm-popup__title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin: 0;
}

.cart-confirm-popup__subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

.cart-confirm-popup__actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
}

.cart-confirm-popup__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cart-confirm-popup__btn--checkout {
    background: linear-gradient(135deg, #3b5be6 0%, #2a47c9 100%);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(59, 91, 230, 0.3);
}

.cart-confirm-popup__btn--checkout:hover {
    background: linear-gradient(135deg, #2a47c9 0%, #1e38a8 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(59, 91, 230, 0.4);
    transform: translateY(-1px);
}

.cart-confirm-popup__btn--continue {
    background: #f3f4f6;
    color: #374151 !important;
    border: 1px solid #e5e7eb;
}

.cart-confirm-popup__btn--continue:hover {
    background: #e5e7eb;
    color: #111827 !important;
}

/* Progress bar auto-close indicator */
.cart-confirm-popup__progress {
    height: 3px;
    background: #e5e7eb;
    overflow: hidden;
}

.cart-confirm-popup__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b5be6, #10b981);
    width: 100%;
    transform-origin: left;
    animation: cartProgressShrink 6s linear forwards;
}

@keyframes cartProgressShrink {
    0% { transform: scaleX(1); }
    100% { transform: scaleX(0); }
}
