/*
Theme Name: ProtiDokan Theme
Author: Your Name
Description: Shopee Style Mobile Theme with Multi-vendor & All Categories Page
Version: 7.0
Text Domain: proti-dokan
*/

:root {
    --shopee-orange: #ee4d2d;
    --bg-gray: #f5f5f5;
    --text-color: #333;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0; padding: 0;
    background-color: var(--bg-gray);
    padding-bottom: 70px; /* Bottom Menu Space */
    color: var(--text-color);
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

/* --- HEADER --- */
.app-header {
    background: linear-gradient(-180deg, #f53d2d, #f63);
    padding: 10px; position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.header-wrapper { display: flex; align-items: center; gap: 10px; }
.search-box {
    background: white; padding: 6px 10px; border-radius: 2px;
    flex-grow: 1; display: flex; align-items: center;
}
.search-box input { border: none; width: 100%; outline: none; font-size: 14px; }

/* --- SLIDER --- */
.slider-container {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.slide { min-width: 100%; scroll-snap-align: start; }
.slide img { width: 100%; height: auto; object-fit: cover; }

/* --- HOME CATEGORIES --- */
.section-box { background: white; margin-bottom: 8px; padding: 10px; }
.category-scroll { display: flex; overflow-x: auto; gap: 15px; scrollbar-width: none; padding-bottom: 5px; }
.cat-item { min-width: 70px; text-align: center; font-size: 11px; display: flex; flex-direction: column; align-items: center; }
.cat-icon { width: 50px; height: 50px; border-radius: 15px; border: 1px solid #eee; margin-bottom: 5px; overflow: hidden; }
.cat-icon img { width: 100%; height: 100%; object-fit: cover; }

/* --- FLASH SALE --- */
.fs-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.fs-title { color: var(--shopee-orange); font-weight: 800; font-style: italic; font-size: 16px; text-transform: uppercase; }
.fs-price { color: var(--shopee-orange); font-weight: bold; font-size: 14px; text-align: center; }

/* --- PRODUCT GRID --- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 8px; }
.product-card { background: white; border: 1px solid var(--border-color); border-radius: 2px; overflow: hidden; padding-bottom: 10px; }
.p-title { font-size: 12px; line-height: 1.4; height: 34px; overflow: hidden; padding: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-price { color: var(--shopee-orange); font-size: 16px; font-weight: bold; padding: 0 5px; }
.add-btn {
    display: block; width: 90%; margin: 5px auto; background: var(--shopee-orange);
    color: white; text-align: center; padding: 5px 0; font-size: 12px; border-radius: 2px;
}

/* --- WOOCOMMERCE & PAGES FIXES --- */
.main-container { padding: 15px; background: white; min-height: 80vh; }
.woocommerce div.product .product_title { font-size: 20px; margin-top: 10px; }
.woocommerce div.product .price { color: var(--shopee-orange); font-size: 24px; font-weight: bold; }
.woocommerce button.button.alt { 
    background-color: var(--shopee-orange); color: white; width: 100%; border: none; padding: 15px; font-weight: bold;
}
.woocommerce-error, .woocommerce-info, .woocommerce-message { margin: 10px; border-top: 3px solid var(--shopee-orange); }

/* --- BOTTOM NAV --- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: white; border-top: 1px solid #ddd;
    display: flex; justify-content: space-around;
    padding: 8px 0; z-index: 9999;
}
.nav-item { text-align: center; font-size: 10px; color: #666; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.nav-item i { font-size: 18px; margin-bottom: 4px; }
.nav-item.active { color: var(--shopee-orange); }

/* --- NEW: ALL CATEGORIES PAGE DESIGN --- */
.all-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Columns */
    gap: 15px;
    padding: 10px 0;
}
.full-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #333;
}
.cat-img-wrap {
    width: 60px; height: 60px;
    background: #f1f1f1;
    border-radius: 18px; /* Slightly rounded */
    border: 1px solid #e0e0e0;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 5px;
    overflow: hidden;
}
.cat-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.cat-name {
    font-size: 11px;
    line-height: 1.2;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cat-count { font-size: 10px; color: #999; margin-top: 2px; }

/* Mobile Responsive Adjustments */
@media (max-width: 400px) {
    .all-cat-grid { grid-template-columns: repeat(3, 1fr); }
}
/* --- APP ICON MENU FIX (Daraz Style) --- */

/* পুরো সেকশনটি সাদা হবে */
.app-icon-section {
    background: #ffffff;
    padding: 15px 10px;
    margin-bottom: 10px;
}

/* গ্রিড সিস্টেম: এক লাইনে ৫টি আইকন থাকবে */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* ৫ কলাম */
    gap: 15px 8px; /* আইকনগুলোর মাঝখানের গ্যাপ */
    justify-items: center; /* সেন্টারে থাকবে */
}

/* প্রতিটি আইকন আইটেম */
.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    width: 100%;
}

/* আইকনের ছবির বক্স */
.icon-img-box {
    width: 48px;  /* আইকনের সাইজ */
    height: 48px;
    border-radius: 12px; /* চারকোনা একটু গোল */
    overflow: hidden;
    margin-bottom: 5px;
    background: #f1f1f1; /* ছবি না থাকলে ধূসর দেখাবে */
}

/* আইকনের ছবি */
.icon-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* বক্সের সাথে ফিট হবে */
}

/* আইকনের নিচের লেখা */
.icon-title {
    font-size: 10px; /* ছোট ফন্ট */
    line-height: 1.2;
    color: #333;
    text-align: center;
    max-width: 100%;
    /* ২ লাইনের বেশি হলে ... দেখাবে */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* রেস্পন্সিভ ফিক্স (খুব ছোট মোবাইলের জন্য) */
@media (max-width: 350px) {
    .icon-grid {
        grid-template-columns: repeat(4, 1fr); /* খুব ছোট স্ক্রিনে ৪টি দেখাবে */
    }
}
/* --- NEW HEADER FORCE STYLE --- */

/* হেডার মেইন বক্স */
.pd-new-header {
    background: linear-gradient(90deg, #ee4d2d 0%, #ff7337 100%);
    padding: 10px 15px;
    position: sticky;
    top: 0;
    z-index: 99999; /* সবার উপরে থাকার জন্য */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ফ্লেক্স লেআউট (পাশাপাশি রাখা) */
.pd-header-inner {
    display: flex;
    align-items: center;
    gap: 15px; /* লোগো ও সার্চের মাঝের গ্যাপ */
    width: 100%;
}

/* লোগো সাইজ */
.pd-logo-area {
    flex-shrink: 0; /* লোগো ছোট হবে না */
    max-width: 120px;
}
.pd-logo-area img {
    height: 40px !important;
    width: auto !important;
    object-fit: contain;
    display: block;
}
/* লোগো না থাকলে টেক্সট স্টাইল */
.pd-site-title {
    color: white;
    font-weight: bold;
    font-size: 18px;
    text-transform: uppercase;
    text-decoration: none;
}

/* সার্চ বার (পুরো জায়গা নিবে) */
.pd-search-area {
    flex-grow: 1;
    width: 100%;
}
.pd-search-form {
    display: flex;
    width: 100%;
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    height: 40px;
}
.pd-search-form input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0 15px;
    font-size: 14px;
    color: #333;
    outline: none;
}
.pd-search-form button {
    background: #fff;
    border: none;
    padding: 0 15px;
    color: #ee4d2d;
    font-size: 18px;
    cursor: pointer;
}

/* আগের কোনো কার্ট আইকন থেকে গেলে তা হাইড করা */
.header-cart, .cart-icon {
    display: none !important;
}

/* --- TOP BANNER --- */
.top-banner-area {
    width: 100%;
    background: #fff;
    line-height: 0; /* ইমেজের নিচে ফাঁকা জায়গা রিমুভ করতে */
}
.top-banner-area img {
    width: 100%;
    height: auto;
    max-height: 80px; /* ব্যানারের সর্বোচ্চ উচ্চতা */
    object-fit: cover;
    display: block;
}

/* --- MAIN HEADER --- */
.pd-main-header {
    background: linear-gradient(90deg, #ee4d2d, #ff7337); /* দারাজ অরেঞ্জ */
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

/* Logo */
.h-logo {
    flex-shrink: 0;
    max-width: 100px;
}
.h-logo img {
    height: 35px !important;
    width: auto !important;
}
.site-name {
    color: white; font-weight: bold; font-size: 16px; text-decoration: none;
}

/* Search */
.h-search {
    flex-grow: 1;
}
.h-search-form {
    display: flex;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    height: 35px;
}
.h-search-form input {
    width: 100%;
    border: none;
    padding: 0 10px;
    font-size: 13px;
    outline: none;
}
.h-search-form button {
    background: #fff;
    border: none;
    padding: 0 12px;
    color: #ee4d2d;
    font-size: 16px;
}

/* Cart */
.h-cart {
    position: relative;
    margin-left: 5px;
}
.h-cart a {
    color: white;
    font-size: 22px;
}
.cart-badge {
    position: absolute;
    top: -5px; right: -8px;
    background: white;
    color: #ee4d2d;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    padding: 1px 5px;
    border: 1px solid #ee4d2d;
}

/* --- GLOBAL BUTTON STYLE FIX (FORCE) --- */

.action-buttons {
    display: flex !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 5px 8px 10px 8px !important;
    margin-top: auto !important;
}

/* Cart Button (ProtiDokan Red Style) */
.btn-cart,
a.btn-cart {
    flex: 1 !important;
    background: linear-gradient(135deg, #e62e04 0%, #c0392b 100%) !important; /* লোগোর লাল */
    border: none !important;
    color: #ffffff !important; /* সাদা লেখা */
    font-size: 12px !important;
    font-weight: bold !important;
    text-align: center !important;
    padding: 6px 0 !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    display: block !important;
    line-height: 2 !important;
    box-shadow: 0 2px 5px rgba(192, 57, 43, 0.2) !important;
}

/* Buy Now Button (ProtiDokan Fire Style) */
.btn-buy,
a.btn-buy,
.look-btn,
.buy-btn {
    flex: 1 !important;
    background: linear-gradient(135deg, #f0932b 0%, #eb4d4b 100%) !important; /* লোগোর আগুন */
    border: none !important;
    color: #ffffff !important; /* সাদা লেখা */
    font-size: 12px !important;
    font-weight: bold !important;
    text-align: center !important;
    padding: 6px 0 !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    display: block !important;
    line-height: 2 !important;
    box-shadow: 0 2px 5px rgba(243, 156, 18, 0.2) !important;
}

/* --- Sales Count Style (Daraz Look) --- */

/* সিঙ্গেল পেজের জন্য */
.pd-sold-count-single {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    display: inline-block;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
}
.pd-sold-count-single i {
    color: #e62e04; /* আগুনের আইকন লাল */
    margin-right: 5px;
}

/* শপ পেজ বা লুপের জন্য */
.pd-sold-count-loop, .look-sold-count {
    font-size: 11px;
    color: #757575; /* দারাজের মতো হালকা ছাই রঙ */
    margin-bottom: 5px;
    display: block;
}

/* আইকন থাকলে */
.look-sold-count i {
    margin-right: 3px;
}
