/* -------------------- ফিক্সড অংশ -------------------- */
html, body {
    width: 100%;
    overflow-x: hidden;
    transition: background 0.5s ease;
}

body{
    margin:0;
    font-family:Arial, sans-serif;
    background:#f5f5f5;
    color: #333; 
    animation: fadeIn 0.6s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* মেনু খোলার সময় স্ক্রল লক */
body.scroll-lock {
    overflow-y: hidden;
}

/* ইউজার যেন সার্চ বক্স বা লগইন ফর্মে টাইপ করতে পারে */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* iOS সাফারি ফিক্স */
@supports (-webkit-touch-callout: none) {
    .bottom-nav {
        position: -webkit-sticky;
        position: sticky;
        bottom: 0;
    }
}

/* স্ক্রলবার স্টাইল */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #ff4081;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ffebf2;
}

/* ===== টপ কন্টেইনার ===== */
.top-container.scrolled {
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
    background: linear-gradient(120deg, #ff4081 10%, #ffffff 40%, #ff4081 60%);
}

.top-container {
    background: linear-gradient(120deg, #ff4081 10%, #ffffff 40%, #ff4081 60%);
    padding: 10px 15px;
    position: fixed;
    overflow: hidden;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-bottom-left-radius: 20px; 
    border-bottom-right-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-top: max(10px, env(safe-area-inset-top, 10px));
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.top-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
    transform: skewX(-20deg);
    animation: topShimmer 5s linear infinite;
    z-index: 0;
}

@keyframes topShimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px; 
}

.app-title {
    font-size: 26px;
    font-weight: bold;
    font-family: 'Georgia', serif;
    user-select: none;
    flex-shrink: 0;
    background: linear-gradient(120deg, #ff0000 0%, #ffffff 45%, #ff0000 70%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
}

@keyframes shine {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ===== নোটিফিকেশন ===== */
.notification-btn {
    font-size: 22px; 
    cursor: pointer;
    padding: 5px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    position: relative;
    color: #FFFFFF;
}

.notification-btn svg {
    fill: #FFFFFF !important;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 10px;
    height: 10px;
    background: #ff4757;
    border-radius: 50%;
    border: 1px solid #ff4081;
    color: white;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
}

/* ===== সার্চ ===== */
.search-box-wrapper {
    position:relative;
    width:100%;
    flex-grow: 1; 
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #333;
    pointer-events: none;
    z-index: 1;
}

.search-box {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #333 !important;
    width: 100%;
    padding: 8px 12px 8px 40px;
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box; 
    height: 40px;
    transition: all 0.3s ease;
    font-family: Arial, sans-serif;
}

.search-box:focus {
    background: #fff;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.search-box::placeholder {
    color: #333333 !important;
    opacity: 1;
}

/* ===== মেনু ===== */
.menu-box {
    position:fixed;
    top:100px;
    right:10px;
    background:white;
    width:200px;
    border-radius:10px;
    box-shadow:0 5px 15px rgba(0,0,0,0.2);
    display:none;
    z-index:2000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
}

.menu-box.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.menu-item {
    padding:12px;
    border-bottom:1px solid #eee;
    cursor:pointer;
    color: #333;
    transition: background 0.1s, transform 0.1s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-item:hover {
    background: #f5f5f5;
}

.menu-item:active {
    transform: scale(0.98);
}

.menu-item:last-child {
    border:none;
}

/* ===== ব্যানার স্লাইডার ===== */
.banner-container {
    width: 100%;
    margin-top: 75px;
    overflow: hidden;
    background: #f5f5f5; 
    padding: 10px 0 5px 0;
    min-height: 160px;
    display: flex;
    position: relative;
    box-sizing: border-box;
}

.banner-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
    cursor: grab;
    user-select: none;
    touch-action: pan-y;
}

.banner-wrapper:active {
    cursor: grabbing;
}

.banner-container img {
    width: calc(100% - 20px);
    height: 150px;
    border-radius: 15px;
    object-fit: cover;
    flex-shrink: 0;
    margin: 0 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* ===== ডেস্কটপের জন্য ব্যানার ফিক্স ===== */
@media (min-width: 768px) {
    .banner-container {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        padding: 15px 0;
        min-height: 400px;
    }
    
    .banner-container img {
        width: calc(100% - 40px);
        max-width: 1120px;
        height: 400px;
        margin: 0 20px;
        border-radius: 20px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    
    /* বড় ডেস্কটপের জন্য */
    @media (min-width: 1200px) {
        .banner-container {
            min-height: 400px;
        }
        
        .banner-container img {
            height: 400px;
        }
    }
}

.banner-container img:active {
    transform: scale(0.98);
}

.banner-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.dot.active {
    background: #fff;
    width: 20px;
    border-radius: 10px;
}

.banner-clone {
    opacity: 0.9;
}

@media (display-mode: standalone) {
    .top-container {
        padding-top: max(10px, env(safe-area-inset-top));
    }
    .banner-container {
        margin-top: calc(80px + env(safe-area-inset-top));
    }
}

/* ===== ক্যাটাগরি ===== */
.category-area {
    margin: 5px 10px 10px 10px;
    background: linear-gradient(120deg, #ffffff 10%, #ff4081 40%, #ffffff 60%);
    padding: 15px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    animation: slideLeft 0.8s ease-out forwards;
}

.category-scroll {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none; 
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-card {
    width: 75px;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.category-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background: #ffffff;
    padding: 1px; 
    border: 2px solid #4CAF50; 
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.category-card span {
    display: block;
    font-size: 12px;
    margin-top: 8px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-card:active {
    transform: scale(0.92);
}

/* ===== প্রোডাক্ট গ্রিড ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    padding-bottom: 80px;
    align-items: stretch;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
        padding: 20px;
        padding-bottom: 80px;
    }
}

/* ডেস্কটপের জন্য প্রোডাক্ট গ্রিড ফিক্স */
@media (min-width: 1200px) {
    .product-grid {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===== প্রোডাক্ট কার্ড ===== */
.product-card {
    background: white;
    padding: 10px;
    border: 1px solid #ff4081;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 280px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box; 
}

.product-card:active {
    transform: scale(0.98);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.product-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 10px;
    background: #f5f5f5;
    display: block; 
}

/* ব্যাজ */
.product-card .badge-discount {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ff4757;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 20px;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(255,71,87,0.3);
}

.product-card .badge-out {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 20px;
    z-index: 1;
}

.product-card .free-del {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #2ed573;
    color: white;
    font-size: 8px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(46,213,115,0.3);
    z-index: 1;
}

.product-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 8px 0 4px;
    color: #333;
    height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

/* প্রাইস */
.product-card .price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.product-card .curr-price {
    color: #E91E63;
    font-weight: 700;
    font-size: 16px;
}

.product-card .old-price {
    color: #999;
    text-decoration: line-through;
    font-size: 12px;
}

/* ইনফো রো */
.product-card .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #666;
    margin-top: 6px;
    border-top: 1px solid #f0f0f0;
    padding-top: 6px;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
}

/* রেটিং */
.product-card .rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 9px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.2;
}

/* সল্ড কাউন্ট */
.product-card .sold-count {
    color: #ff4500;
    font-weight: 600;
    font-size: 9px;
    background: #fff1e6;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.2;
}

/* বড় সংখ্যা */
.product-card .rating.large-number,
.product-card .sold-count.large-number {
    font-size: 8px;
    padding: 3px 5px;
    letter-spacing: -0.2px;
}

/* স্টক স্ট্যাটাস */
.product-card .stock-status {
    font-size: 9px;
    font-weight: 600;
    margin-top: 4px;
    padding: 2px 0;
}

/* স্ট্যাগার অ্যানিমেশন */
.product-card.init-hidden {
    opacity: 0;
    transform: translateY(15px);
}

.product-card.show {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ===== বটম নেভিগেশন ===== */
.bottom-nav {
    height: 50px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: 0 -1px 8px rgba(0,0,0,0.1);
    z-index: 9999;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.nav-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-icon {
    width: 24px;
    height: 24px;
    fill: #757575;
}

.nav-item span {
    font-size: 12px;
    margin-top: 2px;
    color: #757575;
}

.nav-item.active .nav-icon {
    fill: #E91E63;
}

.nav-item.active span {
    color: #E91E63;
    font-weight: 600;
}

/* ===== অ্যানিমেশন ===== */
@keyframes fadeIn {
    from { opacity:0; transform:translateY(10px); }
    to { opacity:1; transform:translateY(0); }
}

@keyframes slideRight { 
    from { transform: translateX(50px); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}

@keyframes slideLeft { 
    from { transform: translateX(-50px); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}

@keyframes slideFromLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body.slide-left {
    animation: slideFromLeft 0.35s ease !important;
}

@keyframes bellSwing {
    0%   { transform: rotate(0deg); }
    15%  { transform: rotate(15deg); }
    30%  { transform: rotate(-15deg); }
    45%  { transform: rotate(10deg); }
    60%  { transform: rotate(-10deg); }
    75%  { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

.bell-swing {
    animation: bellSwing 0.8s ease-in-out;
    transform-origin: top center;
}

/* ===== ইউটিলিটি ===== */
.empty-state, .error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: white;
    border-radius: 12px;
    margin: 20px 0;
}

.empty-icon, .error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.retry-btn {
    background: #ff4081;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #e91e63;
    transform: scale(1.05);
}

.retry-btn:active {
    transform: scale(0.95);
}

.skeleton {
    background: #eee;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    border-radius: 10px;
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

.skeleton-card {
    height: 220px;
    width: 100%;
    margin-bottom: 10px;
}

.fab {
    position: fixed;
    bottom: 70px;
    right: 10px;
    width: 50px;
    height: 50px;
    background: #FF4081;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 9;
    transition: all 0.3s ease;
}

.fab:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* সাফারি ফিক্স */
@supports (-webkit-touch-callout: none) {
    .search-box, input, textarea, select {
        font-size: 16px;
    }
}

/* সর্ট অপশন */
.sort-option-btn {
    text-align: left;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: all 0.2s ease;
}

.sort-option-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.sort-option-btn:active {
    transform: scale(0.98);
}