/*
Theme Name: QAAP
Theme URI: https://example.com/qaap-theme
Author: QAAP Theme
Description: Modern Electronics Store Design with Tailwind CSS.
Version: 1.0
Text Domain: qaap
*/

body { font-family: 'Inter', sans-serif; }
.electro-blue { color: #2b38d1; }
.bg-electro-blue { background-color: #2b38d1; }
.electro-pink { color: #85bcb3; }
.bg-electro-pink { background-color: #85bcb3; }
.border-electro-blue { border-color: #2b38d1; }

.qaap-product-card-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #f9fafb;
    color: #111827;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
}

.qaap-product-card-button svg {
    display: block;
    width: 0.9375rem !important;
    height: 0.9375rem !important;
    flex: 0 0 0.9375rem;
    max-width: 0.9375rem;
    max-height: 0.9375rem;
    margin: 0;
}

.qaap-product-card-button:hover {
    background: #2b38d1;
    border-color: #2b38d1;
    color: #ffffff;
}

/* Smooth dropdown transition */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}
.group:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hide scrollbar */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Offcanvas Transitions */
.offcanvas-open { transform: translateX(0) !important; }
.overlay-open { opacity: 1 !important; visibility: visible !important; }
.modal-open { opacity: 1 !important; visibility: visible !important; transform: scale(1) !important; }

/* Force consistent logo size */
header .qaap-main-logo,
header .qaap-logo-fallback {
    height: 125px;
    width: auto;
    max-height: 125px;
    object-fit: contain;
}

@media (max-width: 1023px) {
    header .qaap-main-logo,
    header .qaap-logo-fallback {
        height: 58px;
        max-height: 58px;
        width: auto;
    }
}

/* iOS Safe Area Support */
.pb-safe { padding-bottom: env(safe-area-inset-bottom); }

/* Mobile offcanvas menu polish */
.qaap-mobile-menu-scroll {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#mobile-menu {
    box-shadow: 24px 0 60px rgba(15, 23, 42, 0.18);
}

#mobile-menu .qaap-mobile-menu-footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

.qaap-mobile-menu-list,
.qaap-mobile-menu-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.qaap-mobile-menu-item,
.qaap-mobile-menu-list > li {
    margin-bottom: 0.5rem;
}

.qaap-mobile-menu-item > a,
.qaap-mobile-menu-list > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #111827;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
}

.qaap-mobile-menu-item > a:hover,
.qaap-mobile-menu-list > li > a:hover,
.qaap-mobile-menu-item.current-menu-item > a,
.qaap-mobile-menu-item.current_page_item > a,
.qaap-mobile-menu-list > li.current_page_item > a,
.qaap-mobile-menu-list > li.current-menu-item > a {
    border-color: #2b38d1;
    background: #eef2ff;
    color: #2b38d1;
}

.qaap-mobile-menu-list .sub-menu {
    margin-top: 0.35rem;
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 2px solid #e5e7eb;
}

.qaap-mobile-menu-list .sub-menu li {
    margin-bottom: 0.35rem;
}

.qaap-mobile-menu-list .sub-menu a {
    display: block;
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #4b5563;
}

.qaap-mobile-menu-list .sub-menu a:hover {
    color: #2b38d1;
    background: #eff6ff;
}

#mobile-menu nav > a {
    position: relative;
}

#mobile-menu nav > a + a {
    border-top: 1px solid #f3f4f6;
}

#mobile-menu nav > a:hover {
    background: #f9fafb;
}

#mobile-menu nav > a svg {
    transition: transform 0.2s ease, color 0.2s ease;
}

#mobile-menu nav > a:hover svg {
    transform: translateX(2px);
    color: #2b38d1;
}

.qaap-mobile-account-cta {
    box-shadow: 0 12px 30px rgba(43, 56, 209, 0.22);
}

.qaap-mobile-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.qaap-mobile-category-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.7rem 0.55rem;
    border: 1px solid #eef2f7;
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    color: #111827;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.qaap-mobile-category-thumb {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    overflow: hidden;
    border-radius: 0.9rem;
    background: #e8f4f2;
    color: #85bcb3;
}

.qaap-mobile-category-name {
    display: -webkit-box;
    min-height: 2.15em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.08;
}

.qaap-mobile-category-count {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9ca3af;
}

.qaap-mobile-category-tree {
    margin-top: 1rem;
    overflow: hidden;
    border: 1px solid #edf1f6;
    border-radius: 1rem;
    background: #ffffff;
}

.qaap-mobile-tree-title {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid #edf1f6;
    color: #111827;
    font-size: 0.76rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.qaap-mobile-tree-item {
    border-bottom: 1px solid #f1f4f8;
}

.qaap-mobile-tree-item:last-child {
    border-bottom: 0;
}

.qaap-mobile-tree-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    color: #2f3848;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 850;
    list-style: none;
    text-transform: uppercase;
}

.qaap-mobile-tree-item summary::-webkit-details-marker {
    display: none;
}

.qaap-mobile-tree-item[open] summary svg {
    transform: rotate(90deg);
}

.qaap-mobile-tree-children {
    display: grid;
    gap: 0.15rem;
    padding: 0 0.9rem 0.8rem;
}

.qaap-mobile-tree-children a {
    border-radius: 0.6rem;
    color: #4b5563;
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 750;
    text-decoration: none;
}

.qaap-mobile-tree-children a:hover {
    background: #f4f7ff;
    color: #2b38d1;
}

/* ===== WhatsApp Floating Button ===== */
.qaap-whatsapp-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 40;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: grid;
    place-items: center;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.qaap-whatsapp-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 28px rgba(37, 211, 102, 0.6);
}

.qaap-whatsapp-icon {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
}

.qaap-whatsapp-icon svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.qaap-whatsapp-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.35);
    animation: qaapPulse 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.qaap-whatsapp-pulse-2 {
    animation-delay: 1.1s;
}

@keyframes qaapPulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

@media (max-width: 1024px) {
    .qaap-whatsapp-btn {
        bottom: 5rem;
        width: 52px;
        height: 52px;
    }
    .qaap-whatsapp-btn .qaap-whatsapp-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* ===== Back to Top with Progress Ring ===== */
.qaap-back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 40;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.qaap-back-to-top.qaap-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.qaap-back-to-top:hover {
    box-shadow: 0 4px 24px rgba(43, 56, 209, 0.25);
    background: #f0f1ff;
}

.qaap-back-to-top-progress {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.qaap-progress-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 3;
}

.qaap-progress-fill {
    fill: none;
    stroke: #2b38d1;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 150.796;
    stroke-dashoffset: 150.796;
    transition: stroke-dashoffset 0.15s ease-out;
}

.qaap-back-to-top-arrow {
    position: relative;
    z-index: 1;
    color: #2b38d1;
    transition: transform 0.3s ease;
}

.qaap-back-to-top:hover .qaap-back-to-top-arrow {
    transform: translateY(-2px);
}

@media (max-width: 1024px) {
    .qaap-back-to-top {
        bottom: 5rem;
        width: 46px;
        height: 46px;
    }
}

/* ===== Hero Slider ===== */
#qaap-hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
}

.qaap-hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.7s ease;
}

.qaap-hero-slide.qaap-slide-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.qaap-hero-slide.qaap-slide-active img {
    animation: qaapHeroZoom 8s ease-out forwards;
}

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

.qaap-hero-dot {
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
}

.qaap-hero-dot.bg-white {
    background: #fff !important;
}

.qaap-hero-dot:hover {
    background: rgba(255, 255, 255, 0.8) !important;
}

.qaap-hero-arrow {
    border: none;
    cursor: pointer;
    outline: none;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
}

#qaap-hero-slider:hover .qaap-hero-arrow {
    opacity: 1;
}

@media (max-width: 767px) {
    .qaap-hero-arrow {
        opacity: 1;
        width: 36px;
        height: 36px;
    }
.qaap-hero-arrow svg {
        width: 14px;
        height: 14px;
    }
}

/* ===== Hero Banner ===== */
.qaap-banner-link {
    text-decoration: none;
    border: none;
    outline: none;
}

.qaap-banner-link img {
    display: block;
}

.qaap-footer-logo,
.woocommerce .qaap-footer-logo,
.woocommerce-page .qaap-footer-logo {
    filter: none;
    width: auto;
    max-width: 180px;
    height: auto;
}

.qaap-footer-payment-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.qaap-footer-payment-image {
    max-width: 280px;
    width: 100%;
    height: auto;
    filter: none;
    opacity: 1;
}

@media (max-width: 767px) {
    .qaap-footer-payment-wrap {
        justify-content: center;
    }

    .qaap-footer-payment-image {
        max-width: 180px;
    }
}
