/* style.css - Title Fix & SEO Layout */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --bg: #e0e5ec;
    --text: #4a4a4a;
    --primary: #fd79a8;
    --shadow-light: #ffffff;
    --shadow-dark: #a3b1c6;
    --radius: 15px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Nunito', sans-serif; touch-action: manipulation; }
body { background-color: var(--bg); color: var(--text); padding-bottom: 50px; overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; }

/* --- Utilities --- */
.neu-box {
    background: var(--bg);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.2);
}
.neu-btn {
    padding: 10px 20px; border: none; outline: none; cursor: pointer;
    background: var(--bg); color: var(--primary); font-weight: 800; border-radius: 50px;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    transition: 0.2s; font-size: 0.9rem;
}
.neu-btn:active, .neu-btn.active { box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light); }

.neu-input {
    width: 100%; padding: 12px; border: none; outline: none; border-radius: 50px;
    background: var(--bg); color: var(--text);
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    font-size: 1rem;
}

/* --- Header --- */
header {
    display: flex; flex-direction: column; gap: 15px; align-items: center; padding: 15px 5%;
    position: sticky; top: 0; z-index: 100; background: var(--bg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.top-row { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text); cursor: pointer; }
.search-container { width: 100%; max-width: 500px; }

/* --- CATEGORY SECTION --- */
.categories-scroll {
    display: flex; gap: 20px; overflow-x: auto; padding: 15px 5px 25px 5px;
    margin-bottom: 20px; scrollbar-width: none; justify-content: flex-start;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.category-item {
    display: flex; flex-direction: column; align-items: center; cursor: pointer;
    flex: 0 0 auto; min-width: 70px;
}
.category-img-wrap {
    width: 70px; height: 70px; border-radius: 50%;
    background: var(--bg);
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    display: flex; align-items: center; justify-content: center;
    border: 2px solid transparent; transition: all 0.2s ease; overflow: hidden;
}
.category-img { width: 40px !important; height: 40px !important; object-fit: contain; }
.category-name { font-size: 0.85rem; font-weight: 700; margin-top: 8px; color: #666; }

.category-item.active .category-img-wrap {
    box-shadow: inset 5px 5px 10px var(--shadow-dark), inset -5px -5px 10px var(--shadow-light);
    border-color: var(--primary);
}
.category-item.active .category-name { color: var(--primary); }

/* LAPTOP VIEW */
@media (min-width: 900px) {
    .categories-scroll { justify-content: center; gap: 40px; }
    .category-item { min-width: 90px; }
    .category-img-wrap { width: 90px; height: 90px; }
    .category-img { width: 50px !important; height: 50px !important; }
    .category-name { font-size: 1rem; margin-top: 12px; }
}

/* --- Grid & Products --- */
.container { padding: 20px 5%; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }

.product-card {
    padding: 15px; text-align: center; cursor: pointer;
    display: flex; flex-direction: column; justify-content: space-between;
    height: 100%; /* Fix height alignment */
}
.product-img { width: 100%; height: 150px; object-fit: contain; margin-bottom: 10px; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.1)); }

/* --- TITLE FIX (Long Text Hidden) --- */
.card-content h3 { 
    font-size: 1rem; 
    margin-bottom: 5px; 
    
    /* Ye 3 lines magic karengi: */
    white-space: nowrap;      /* Line break nahi hone dega */
    overflow: hidden;         /* Extra text chupayega */
    text-overflow: ellipsis;  /* Last me '...' dikhayega */
    
    max-width: 100%;
    display: block;
}

.price { color: var(--primary); font-weight: bold; font-size: 1.1rem; }

/* --- Pagination --- */
.pagination-container {
    margin-top: 30px; display: flex; justify-content: center; gap: 15px; align-items: center;
}
.page-btn { padding: 10px 15px; min-width: 40px; text-align: center; }
.page-btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* --- Responsive --- */
@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) {
    .grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .container { padding: 20px 3%; }
    .product-card { padding: 10px; }
    .product-img { height: 100px; }
    .logo { font-size: 1.2rem; }
}

/* --- Modals --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(224, 229, 236, 0.9); z-index: 200;
    justify-content: center; align-items: center; backdrop-filter: blur(5px);
}
.modal-box { width: 90%; max-width: 500px; padding: 30px; position: relative; max-height: 85vh; overflow-y: auto; }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; cursor: pointer; }