/* ============================================================
   PHASE 1 STRATEGIC UPGRADES
   - Mega dropdown navigation
   - WhatsApp sticky CTA
   - Product page conversion blocks
   - Enhanced filter/sort toolbar
   - Mobile sticky cart bar
   ============================================================ */

/* ============================================================
   1. MEGA DROPDOWN NAVIGATION
   ============================================================ */
.main-menu .has-dropdown {
    position: relative;
}

.main-menu .has-dropdown > a {
    display: flex;
    align-items: center;
}

.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 720px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1000;
    border: 1px solid rgba(201,169,110,0.1);
}

.main-menu .has-dropdown:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.mega-dropdown-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr) 1.1fr;
    gap: 0;
    padding: 24px 0;
}

.mega-col {
    padding: 0 20px;
    border-right: 1px solid rgba(0,0,0,0.04);
}
.mega-col:last-child {
    border-right: none;
}

.mega-col h4 {
    font-family: 'Playfair Display', serif;
    font-size: 13px;
    font-weight: 600;
    color: #2a2520;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mega-col h4 i {
    color: var(--gold, #c9a96e);
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.mega-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mega-col ul li a {
    display: block;
    font-size: 12.5px;
    color: #6b6158;
    padding: 5px 0;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 400;
}
.mega-col ul li a:hover {
    color: var(--gold, #c9a96e);
    padding-left: 4px;
}

/* Mega promo card */
.mega-col-promo {
    padding: 0 20px;
    display: flex;
    align-items: stretch;
}
.mega-promo-card {
    background: linear-gradient(145deg, #2a2520, #1a1814);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    position: relative;
    overflow: hidden;
}
.mega-promo-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(201,169,110,0.15), transparent);
    border-radius: 50%;
}
.mega-promo-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold, #c9a96e);
    margin-bottom: 8px;
}
.mega-promo-card h4 {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 16px;
    margin-bottom: 6px;
}
.mega-promo-card p {
    font-size: 11.5px;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    margin-bottom: 14px;
}
.mega-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gold, #c9a96e);
    text-decoration: none;
    transition: all 0.2s;
}
.mega-promo-btn:hover {
    color: var(--gold-light, #e8d5a3);
    gap: 10px;
}

/* ============================================================
   2. WHATSAPP STICKY CTA
   ============================================================ */
.whatsapp-sticky {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 0;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.whatsapp-sticky-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(37,211,102,0.35), 0 2px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    z-index: 2;
}
.whatsapp-sticky-btn i {
    font-size: 28px;
    color: #fff;
}
.whatsapp-sticky-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(37,211,102,0.45), 0 4px 12px rgba(0,0,0,0.15);
}

/* Pulse animation on the button */
.whatsapp-sticky-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37,211,102,0.3);
    animation: whatsappPulse 2s ease-out infinite;
    z-index: -1;
}
@keyframes whatsappPulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Tooltip label */
.whatsapp-sticky-label {
    position: absolute;
    right: 64px;
    white-space: nowrap;
    background: #fff;
    color: #2a2520;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateX(8px);
    pointer-events: none;
    transition: all 0.3s ease;
}
.whatsapp-sticky-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid #fff;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}
.whatsapp-sticky:hover .whatsapp-sticky-label {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================================
   3. PRODUCT PAGE CONVERSION BLOCKS
   ============================================================ */
.product-trust-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
    padding: 0;
}

.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #faf8f5;
    border-radius: 10px;
    border: 1px solid rgba(201,169,110,0.1);
    transition: all 0.2s ease;
}
.trust-badge-item:hover {
    border-color: rgba(201,169,110,0.25);
    background: #f7f4ef;
}

.trust-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}
.trust-badge-icon.stock { background: rgba(46,125,50,0.25); color: #2e7d32; }
.trust-badge-icon.delivery { background: rgba(21,101,192,0.25); color: #1565c0; }
.trust-badge-icon.custom { background: rgba(201,169,110,0.25); color: #b8941f; }
.trust-badge-icon.warranty { background: rgba(142,68,173,0.25); color: #8e44ad; }
.trust-badge-icon.bahrain { background: rgba(201,169,110,0.25); color: #c9a96e; }
.trust-badge-icon.projects { background: rgba(230,126,34,0.25); color: #e67e22; }

.trust-badge-text {
    display: flex;
    flex-direction: column;
}
.trust-badge-text strong {
    font-size: 12px;
    font-weight: 600;
    color: #2a2520;
    line-height: 1.2;
}
.trust-badge-text span {
    font-size: 10.5px;
    color: #8a7e74;
    line-height: 1.3;
}

/* ============================================================
   4. SHOP PAGE ENHANCED FILTER TOOLBAR (Mobile)
   ============================================================ */
.mobile-filter-bar {
    display: none;
    gap: 8px;
    padding: 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mobile-filter-bar::-webkit-scrollbar { display: none; }

.mobile-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e0dbd5;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #6b6158;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}
.mobile-filter-chip:hover,
.mobile-filter-chip.active {
    border-color: var(--gold, #c9a96e);
    color: var(--gold, #c9a96e);
    background: rgba(201,169,110,0.06);
}
.mobile-filter-chip i {
    font-size: 11px;
}

/* Sort pills for shop page */
.sort-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.sort-pill {
    padding: 6px 14px;
    border: 1px solid #e0dbd5;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    color: #6b5e52;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}
.sort-pill:hover,
.sort-pill.active {
    border-color: var(--gold, #c9a96e);
    color: var(--gold, #c9a96e);
    background: rgba(201,169,110,0.06);
}

/* ============================================================
   5. MOBILE STICKY ADD TO CART BAR
   ============================================================ */
.mobile-sticky-cart {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    padding: 10px 16px;
    z-index: 997;
    gap: 10px;
    align-items: center;
}
.mobile-sticky-cart .sticky-price {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: #2a2520;
    flex-shrink: 0;
}
.mobile-sticky-cart .sticky-price .compare {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    margin-left: 6px;
}
.mobile-sticky-cart .btn-sticky-cart {
    flex: 1;
    padding: 12px 20px;
    background: #2a2520;
    color: var(--gold-light, #e8d5a3);
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}
.mobile-sticky-cart .btn-sticky-cart:active {
    background: var(--gold, #c9a96e);
    color: #fff;
}
.mobile-sticky-cart .btn-sticky-whatsapp {
    width: 44px;
    height: 44px;
    background: #25D366;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   6. ENHANCED SHOP SORT BAR
   ============================================================ */
.shop-sort-enhanced {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.shop-sort-enhanced .sort-label {
    font-size: 12px;
    color: #8a7e74;
    font-weight: 500;
}

/* ============================================================
   7. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .mega-dropdown {
        width: 600px;
    }
    .mega-dropdown-inner {
        grid-template-columns: repeat(3, 1fr);
    }
    .mega-col:nth-child(4),
    .mega-col-promo {
        display: none;
    }
}

@media (max-width: 768px) {
    .mega-dropdown {
        display: none !important;
    }

    .mobile-filter-bar {
        display: flex;
    }

    .mobile-sticky-cart {
        display: flex;
    }

    /* Adjust WhatsApp button position when mobile sticky cart is present */
    .whatsapp-sticky {
        bottom: 80px;
    }

    .product-trust-badges {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .whatsapp-sticky-btn {
        width: 50px;
        height: 50px;
    }
    .whatsapp-sticky-btn i {
        font-size: 24px;
    }
    .whatsapp-sticky {
        bottom: 76px;
        right: 16px;
    }
}

/* ============================================================
   8. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-sticky-btn::after {
        animation: none;
    }
    .mega-dropdown {
        transition: none;
    }
    .whatsapp-sticky-label {
        transition: none;
    }
}
