/* ============================================
   BOTTOM ACTIONS - Scroll to Top + FAB Social Icons
   ============================================ */

/* ✅ السطر الرئيسي - بدون !important */
.bottom-actions {
    position: fixed;
    z-index: 1050;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    left: calc(20px + env(safe-area-inset-left, 0px));
    right: calc(20px + env(safe-area-inset-right, 0px));
}

.bottom-actions > * {
    pointer-events: auto;
}

/* ============================================
   FAB - Social Share Icons (LEFT SIDE)
   ============================================ */
.fab-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    order: 0;
}

.fab-main {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #9f4022, #c75e3a);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(159, 64, 34, 0.35);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.fab-main:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(159, 64, 34, 0.5);
}

.fab-main:active {
    transform: scale(0.92);
}

.fab-main.active {
    transform: rotate(45deg);
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.fab-main.active:hover {
    transform: rotate(45deg) scale(1.05);
}

.fab-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    order: 0;
}

.fab-item {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.25s ease;
    font-size: 1rem;
    opacity: 0;
    transform: translateY(10px) scale(0.85);
    pointer-events: none;
}

/* ✅ عند فتح القائمة */
.fab-container.open .fab-item {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fab-container.open .fab-item:nth-child(1) {
    transition-delay: 0.05s;
}
.fab-container.open .fab-item:nth-child(2) {
    transition-delay: 0.10s;
}
.fab-container.open .fab-item:nth-child(3) {
    transition-delay: 0.15s;
}

.fab-item:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.fab-item:active {
    transform: scale(0.9);
}

/* ✅ الألوان */
.fab-call {
    background: #1976d2;
}
.fab-call:hover {
    background: #1565c0;
}

.fab-whatsapp {
    background: #25D366;
}
.fab-whatsapp:hover {
    background: #1da851;
}

.fab-products {
    background: #9f4022;
}
.fab-products:hover {
    background: #7a3119;
}

/* ============================================
   SCROLL TO TOP (RIGHT SIDE)
   ============================================ */
.scroll-to-top {
    width: 48px;
    height: 48px;
    background: rgba(159, 64, 34, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 3px 15px rgba(159, 64, 34, 0.3);
    font-size: 1.1rem;
    flex-shrink: 0;
    order: 1;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    animation: scrollToTopIn 0.4s ease forwards;
}

@keyframes scrollToTopIn {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.scroll-to-top:hover {
    background: #7a3119;
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(159, 64, 34, 0.45);
}

.scroll-to-top:active {
    transform: scale(0.92);
}

/* ============================================
   ✅ RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 991px) {
    .bottom-actions {
        bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
        left: calc(16px + env(safe-area-inset-left, 0px));
        right: calc(16px + env(safe-area-inset-right, 0px));
    }
}

@media (max-width: 576px) {
    .bottom-actions {
        bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
        left: calc(12px + env(safe-area-inset-left, 0px));
        right: calc(12px + env(safe-area-inset-right, 0px));
    }
}

@media (max-width: 400px) {
    .bottom-actions {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
        left: calc(8px + env(safe-area-inset-left, 0px));
        right: calc(8px + env(safe-area-inset-right, 0px));
    }
}

/* ============================================
   ✅ RESPONSIVE - DESKTOP
   ============================================ */
@media (min-width: 992px) {
    .bottom-actions {
        bottom: 25px;
        right: 25px;
        left: auto;
        justify-content: flex-end;
    }

    .fab-container {
        display: none !important;
    }

    .scroll-to-top {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
}

/* ============================================
   ✅ SAFE AREA SUPPORT
   ============================================ */
@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-actions {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 991px) {
    @supports (padding: env(safe-area-inset-bottom)) {
        .bottom-actions {
            bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
        }
    }
}

@media (max-width: 576px) {
    @supports (padding: env(safe-area-inset-bottom)) {
        .bottom-actions {
            bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
        }
    }
}

@media (max-width: 400px) {
    @supports (padding: env(safe-area-inset-bottom)) {
        .bottom-actions {
            bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
        }
    }
}

@supports (padding: env(safe-area-inset-bottom)) and (min-width: 992px) {
    .bottom-actions {
        bottom: 25px;
    }
}