/* ═══════════════════════════════════════════
   PATEL STORES v2 — Components
   Compact, Amazon-style mobile design
   ═══════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    white-space: nowrap;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
    background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
    color: white;
    box-shadow: 0 3px 12px rgba(232,163,23,0.25);
}
.btn-secondary { background: var(--forest); color: white; }
.btn-secondary:hover { background: var(--forest-dark); }
.btn-outline { background: transparent; border: 2px solid var(--saffron); color: var(--saffron-dark); }
.btn-outline:hover { background: var(--saffron); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-ghost { background: transparent; color: var(--slate); }
.btn-ghost:hover { background: var(--cream-dark); color: var(--charcoal); }
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-full { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-md); }

/* ── Cards ── */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-body { padding: var(--gap-md); }

/* ── Forms ── */
.form-group { margin-bottom: var(--gap-md); }
.form-group label {
    display: block; font-weight: 600; font-size: 0.82rem;
    color: var(--coffee-light); margin-bottom: 5px;
}
.form-input {
    width: 100%; padding: 11px 14px;
    border: 2px solid var(--cream-dark); border-radius: var(--radius-md);
    background: white; font-size: 0.9rem; color: var(--charcoal); outline: none;
    transition: all var(--duration);
}
.form-input:focus { border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(232,163,23,0.1); }
.form-input::placeholder { color: var(--light-slate); }

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
textarea.form-input { resize: vertical; min-height: 70px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-md); }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--saffron); }

/* ── Tags ── */
.tag {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: var(--radius-full);
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.tag-pending { background: var(--orange-light); color: var(--orange); }
.tag-awaiting-payment { background: #FEF3C7; color: #B45309; }
.tag-confirmed { background: var(--blue-light); color: var(--blue); }
.tag-delivering { background: #FEF3C7; color: #D97706; }
.tag-delivered { background: var(--green-light); color: var(--green); }
.tag-cancelled { background: var(--red-light); color: var(--red); }

/* ── Data Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
    text-align: left; padding: 10px 12px; font-weight: 600; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--slate);
    background: var(--cream); border-bottom: 2px solid var(--cream-dark);
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--cream-dark); }
.data-table tr:hover td { background: rgba(232,163,23,0.03); }

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-sm);
    margin-bottom: var(--gap-lg);
}
@media (min-width: 769px) { .stats-grid { grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); } }

.stat-card {
    background: white; border-radius: var(--radius-md);
    padding: var(--gap-md); box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-card.saffron::before { background: var(--saffron); }
.stat-card.green::before { background: var(--forest); }
.stat-card.terra::before { background: var(--terracotta); }
.stat-card.blue::before { background: var(--blue); }
.stat-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--slate); margin-bottom: 2px; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; color: var(--coffee); }
.stat-sub { font-size: 0.75rem; color: var(--light-slate); margin-top: 2px; }

/* ── Tabs ── */
.tabs {
    display: flex; gap: 3px; background: var(--cream-dark);
    padding: 3px; border-radius: var(--radius-full);
    margin-bottom: var(--gap-md); overflow-x: auto;
}
.tab {
    padding: 8px 18px; border-radius: var(--radius-full);
    font-weight: 600; font-size: 0.82rem; cursor: pointer;
    border: none; background: none; color: var(--slate); white-space: nowrap;
    transition: all var(--duration);
}
.tab.active { background: white; color: var(--coffee); box-shadow: var(--shadow-sm); }

/* ── Search ── */
.search-bar { position: relative; margin-bottom: var(--gap-md); }
.search-bar input {
    width: 100%; padding: 11px 14px 11px 42px;
    border: 2px solid var(--cream-dark); border-radius: var(--radius-md);
    font-size: 0.9rem; background: white; outline: none;
}
.search-bar input:focus { border-color: var(--saffron); }
.search-bar .search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 1rem; color: var(--light-slate);
}

/* ═══════════════════════════════════════════
   PRODUCT CARD — Amazon-style compact
   ═══════════════════════════════════════════ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 769px) {
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap-md); }
}

.product-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(0,0,0,0.04);
}
.product-card:active { transform: scale(0.98); }

.product-img {
    height: 180px;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    overflow: hidden;
    position: relative;
    padding: 8px;
}
.product-img img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
}

.product-info { padding: 10px; }
.product-category {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--slate); margin-bottom: 2px;
}
.product-name {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--coffee);
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-price {
    font-weight: 800;
    font-size: 1rem;
    color: var(--forest);
}
.product-actions { margin-top: 8px; }
.product-actions .btn {
    width: 100%;
    padding: 8px;
    font-size: 0.78rem;
    border-radius: var(--radius-md);
}

@media (max-width: 600px) {
    .product-img { height: 130px; font-size: 3rem; }
    .product-info { padding: 8px; }
    .product-name { font-size: 0.8rem; }
    .product-price { font-size: 0.9rem; }
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: var(--gap-xl) var(--gap-md); color: var(--slate); }
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: var(--gap-sm); opacity: 0.5; }
.empty-state h3 { color: var(--coffee-light); margin-bottom: var(--gap-xs); font-size: 1.1rem; }
.empty-state p { font-size: 0.85rem; max-width: 300px; margin: 0 auto; }

/* ── Qty control ── */
.qty-control {
    display: inline-flex; align-items: center;
    border: 2px solid var(--cream-dark); border-radius: var(--radius-md); overflow: hidden;
    background: white;
}
.qty-control button {
    width: 34px; height: 34px; border: none; background: var(--cream);
    cursor: pointer; font-size: 1rem; font-weight: 700; color: var(--coffee-light);
}
.qty-control button:active { background: var(--cream-dark); }
.qty-control span {
    width: 36px; text-align: center; font-weight: 700; font-family: var(--font-mono); font-size: 0.9rem;
}

/* ── Payment ── */
.payment-options { display: flex; flex-direction: column; gap: var(--gap-sm); }
.payment-option {
    display: flex; align-items: center; gap: var(--gap-md);
    padding: var(--gap-md); border: 2px solid var(--cream-dark);
    border-radius: var(--radius-md); cursor: pointer; transition: all var(--duration);
}
.payment-option.selected { border-color: var(--saffron); background: rgba(232,163,23,0.04); }
.payment-option input[type="radio"] { accent-color: var(--saffron); width: 18px; height: 18px; }
.payment-icon { font-size: 1.6rem; }
.payment-label { font-weight: 600; font-size: 0.9rem; }
.payment-desc { font-size: 0.78rem; color: var(--slate); }

/* ── Admin ── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 52px); }
.admin-sidebar {
    background: var(--coffee); padding: var(--gap-md) 0;
    position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto;
}
.sidebar-section { padding: 0 var(--gap-sm); margin-bottom: var(--gap-md); }
.sidebar-label {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--slate); padding: 0 var(--gap-sm); margin-bottom: 4px;
}
.sidebar-link {
    display: flex; align-items: center; gap: 8px;
    padding: 9px var(--gap-sm); border-radius: var(--radius-md);
    color: var(--light-slate); font-weight: 500; font-size: 0.85rem;
    cursor: pointer; text-decoration: none; transition: all var(--duration);
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-link.active { background: rgba(232,163,23,0.15); color: var(--saffron); }
.sidebar-link .sidebar-icon { font-size: 1rem; width: 22px; text-align: center; }

.admin-content { padding: var(--gap-lg); background: #f2ede5; overflow-y: auto; }
.admin-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--gap-lg); flex-wrap: wrap; gap: var(--gap-sm);
}
.admin-header h1 { font-size: 1.5rem; }

@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .admin-content { padding: 10px; }
}

/* ── Upload ── */
.upload-zone {
    border: 2px dashed var(--cream-dark); border-radius: var(--radius-md);
    padding: var(--gap-lg); text-align: center; cursor: pointer;
    background: rgba(255,248,240,0.5); transition: all var(--duration);
}
.upload-zone:hover { border-color: var(--saffron); }
.upload-zone .upload-icon { font-size: 2rem; margin-bottom: var(--gap-xs); }
.upload-zone p { color: var(--slate); font-size: 0.85rem; }
.upload-zone .upload-hint { font-size: 0.75rem; color: var(--light-slate); }
.upload-preview { width: 100px; height: 100px; border-radius: var(--radius-md); object-fit: cover; border: 2px solid var(--cream-dark); }

/* ── Charts ── */
.chart-container {
    background: white; border-radius: var(--radius-md);
    padding: var(--gap-md); box-shadow: var(--shadow-sm); margin-bottom: var(--gap-md);
}
.chart-container h3 { font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; margin-bottom: var(--gap-sm); color: var(--coffee); }
.chart-bar-group { display: flex; align-items: end; gap: 4px; height: 180px; padding-top: var(--gap-sm); }
.chart-bar {
    flex: 1; border-radius: 3px 3px 0 0; min-height: 3px;
    transition: all 0.5s var(--ease-out); position: relative; cursor: pointer;
}
.chart-bar .chart-tooltip {
    display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    background: var(--charcoal); color: white; padding: 3px 8px; border-radius: var(--radius-sm);
    font-size: 0.7rem; white-space: nowrap; margin-bottom: 3px;
}
.chart-bar:hover .chart-tooltip { display: block; }
.chart-labels { display: flex; gap: 4px; margin-top: 6px; }
.chart-labels span { flex: 1; text-align: center; font-size: 0.6rem; color: var(--slate); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-md); }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }

/* Donut */
.donut-chart { width: 160px; height: 160px; border-radius: 50%; margin: 0 auto var(--gap-sm); position: relative; }
.donut-center {
    position: absolute; inset: 28px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.donut-center .donut-total { font-family: var(--font-display); font-size: 1.3rem; color: var(--coffee); }
.donut-center .donut-label { font-size: 0.65rem; color: var(--slate); }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--gap-sm); justify-content: center; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--coffee-light); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
