/* 
 * Grocery App Custom Styles
 * Zepto/Blinkit/Instamart inspired theme
 */

/* General Layout & Spacing */
body {
    font-family: 'Outfit', sans-serif;
    background-color: #f4f6f9; /* Soft grey background */
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Sticky Top Search Bar */
.app-header-search {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
    padding: 12px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-bottom: 1px solid #edf2f7;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper input {
    width: 100%;
    border-radius: 12px;
    padding: 12px 16px 12px 40px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: #2e7d32;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.search-input-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* Product Cards */
.product-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    padding: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.product-card-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.product-card-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 8px;
}

.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #1e7a46;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 2;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.6em;
}

.product-weight {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.price-block {
    display: flex;
    flex-direction: column;
}

.mrp-price {
    font-size: 0.75rem;
    color: #94a3b8;
    text-decoration: line-through;
    line-height: 1;
    margin-bottom: 2px;
}

.selling-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

/* Add to Cart Button widget */
.btn-add-cart {
    background-color: #f1f8f5;
    color: #1e7a46;
    border: 1px solid #d4edda;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-add-cart:hover {
    background-color: #1e7a46;
    color: #fff;
}

.qty-control {
    display: flex;
    align-items: center;
    background: #1e7a46;
    border-radius: 8px;
    overflow: hidden;
    color: white;
    font-weight: 600;
}

.qty-control button {
    background: transparent;
    border: none;
    color: white;
    font-weight: bold;
    width: 30px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qty-control button:active {
    background: rgba(255,255,255,0.2);
}

.qty-control span {
    width: 24px;
    text-align: center;
    font-size: 0.9rem;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #edf2f7;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
    z-index: 1030;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 500;
    gap: 4px;
    transition: color 0.2s ease;
    position: relative;
}

.bottom-nav-item.active {
    color: #1e7a46;
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

.bottom-nav-item.active svg {
    fill: #1e7a46;
    stroke: #1e7a46;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    height: 18px;
    min-width: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    transform: scale(1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-badge.pop {
    transform: scale(1.3);
}

/* Product Details Page */
.product-detail-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
}

.variant-btn {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 12px;
    padding: 10px 16px;
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #ffffff;
}

.variant-btn.active div:last-child {
    color: rgba(255,255,255,0.7) !important;
}

.btn-add-cart-large {
    background-color: #fceb00; /* Yellow from screenshot */
    color: #1a1a1a;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 14px 16px;
    width: 100%;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(252, 235, 0, 0.2);
}

.btn-add-cart-large:active {
    transform: scale(0.98);
}

/* Horizontal scroll container for products/categories */
.prow {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.prow::-webkit-scrollbar {
    display: none;
}
.prow .product-card {
    flex: 0 0 calc(50% - 16px);
    max-width: 180px;
    scroll-snap-align: start;
}

/* Horizontal category row */
.cat-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cat-row::-webkit-scrollbar {
    display: none;
}
.cat-row .cat {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

body {
    padding-bottom: 80px;
}
