/* ============================================================
   KUNGFU HEAD SPA — Shop CSS
   Matches brand: warm earth tones, clean typography
   ============================================================ */

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg: #fef9f4;
    --color-surface: #fff;
    --color-primary: #5a3e1b;
    --color-primary-light: #8b6b40;
    --color-accent: #c97b3a;
    --color-text: #3d2b1a;
    --color-text-light: #7a6b58;
    --color-border: #e0d5c8;
    --color-success: #2d7a3c;
    --color-warning: #b8860b;
    --color-error: #c0392b;
    --color-info: #2c6fba;
    --color-badge-bg: #f5efe6;
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-accent); }

img { max-width: 100%; height: auto; }

/* ─── Shop Wrapper ───────────────────────────────────────────── */
.shop-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Navigation ─────────────────────────────────────────────── */
.shop-nav {
    background: var(--color-primary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.shop-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.shop-logo {
    color: #fff !important;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.shop-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-nav-links a {
    color: #f5efe6 !important;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.shop-nav-links a:hover {
    background: rgba(255,255,255,0.15);
    color: #fff !important;
}

.shop-nav-links .nav-admin {
    background: var(--color-accent);
    font-weight: 600;
}

.shop-nav-links .nav-user {
    color: #f5efe6;
    font-size: 0.9rem;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.shop-nav-links .nav-logout {
    font-size: 0.8rem;
    opacity: 0.8;
}

.btn-register {
    background: var(--color-accent) !important;
    font-weight: 600;
}

/* ─── Back link ──────────────────────────────────────────────── */
.site-back-link {
    background: var(--color-badge-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 6px 20px;
    font-size: 0.85rem;
}

.site-back-link a {
    color: var(--color-text-light);
}

.site-back-link a:hover {
    color: var(--color-primary);
}

/* ─── Main Content ───────────────────────────────────────────── */
.shop-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    width: 100%;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.shop-footer {
    background: var(--color-primary);
    color: #f5efe6;
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
}

.shop-footer a { color: #e0d5c8; }
.shop-footer a:hover { color: #fff; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    transition: all 0.2s;
    text-align: center;
    line-height: 1.4;
}

.btn:hover {
    background: var(--color-badge-bg);
    border-color: var(--color-primary-light);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff !important;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-success {
    background: var(--color-success);
    color: #fff !important;
    border-color: var(--color-success);
}

.btn-danger {
    background: var(--color-error);
    color: #fff !important;
    border-color: var(--color-error);
}

.btn-secondary {
    background: var(--color-badge-bg);
    border-color: var(--color-border);
}

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--color-surface);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(90,62,27,0.1);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.field-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

.required { color: var(--color-error); }

.input-price { width: 120px; }
.input-wide { width: 100%; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert ul { margin: 0 0 0 18px; }
.alert li { margin-bottom: 2px; }

.alert-error {
    background: #fde8e8;
    border-color: #f5c6c6;
    color: var(--color-error);
}

.alert-success {
    background: #e8f5e9;
    border-color: #c6e8c8;
    color: var(--color-success);
}

.alert-warning {
    background: #fff8e1;
    border-color: #ffe082;
    color: var(--color-warning);
}

.alert-info {
    background: #e3f2fd;
    border-color: #bbdefb;
    color: var(--color-info);
}

/* ─── Flash messages ─────────────────────────────────────────── */
.flash {
    padding: 12px 20px;
    margin: 0 auto;
    max-width: 1200px;
    font-size: 0.9rem;
    text-align: center;
}

.flash-success { background: var(--color-success); color: #fff; }
.flash-error { background: var(--color-error); color: #fff; }
.flash-info { background: var(--color-info); color: #fff; }

/* ─── Auth Forms ─────────────────────────────────────────────── */
.auth-form-container {
    max-width: 520px;
    margin: 0 auto;
    background: var(--color-surface);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.auth-form-container h1 {
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--color-text-light);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.auth-form-container h3 {
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
}

.auth-form {
    margin-top: 10px;
}

.auth-alt-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.auth-alt-link a { font-weight: 600; }

/* ─── Catalog ────────────────────────────────────────────────── */
.catalog-page h1 { margin-bottom: 20px; }

.category-filter {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.category-filter select {
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-size: 0.95rem;
    color: var(--color-text);
    min-width: 260px;
    max-width: 100%;
    cursor: pointer;
    font-family: var(--font-family);
}

.category-filter select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(90, 62, 27, 0.15);
}

/* Business pricing notice (admin-editable text) */
.pricing-notice {
    background: var(--color-badge-bg);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.pricing-notice h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--color-primary);
}

.pricing-notice ul {
    margin: 0 0 10px;
    padding-left: 22px;
}

.pricing-notice li {
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 5px;
    line-height: 1.5;
}

.pricing-notice p {
    font-size: 0.9rem;
    color: var(--color-text);
    margin: 0 0 8px;
    line-height: 1.5;
}

.pricing-notice strong {
    color: var(--color-primary);
}

.pricing-notice-cta {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
}

.pricing-notice-cta:hover {
    text-decoration: underline;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.product-card a {
    color: var(--color-text);
}

.product-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--color-badge-bg);
    display: block;
}

.product-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card-title {
    font-size: 1rem;
    margin-bottom: 6px;
}

.product-card-title a {
    color: var(--color-text);
    text-decoration: none;
}

.product-card-title a:hover {
    color: var(--color-primary-light);
}

.product-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
}

.product-card-actions .btn {
    flex: 1;
    text-align: center;
}

.product-card-actions .btn-secondary {
    background: var(--color-badge-bg);
    border-color: var(--color-border);
}

.product-card-desc {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-pricing {
    margin-bottom: 12px;
}

.product-card-price-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-card-price-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.product-card-price-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-light);
    min-width: 44px;
}

.product-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.product-card-price-store {
    color: var(--color-accent);
}

.product-card-msrp {
    font-size: 0.8rem;
    color: var(--color-text-light);
    text-decoration: line-through;
}

/* ─── Product Detail ─────────────────────────────────────────── */
.product-detail { max-width: 960px; }

.breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 24px;
    color: var(--color-text-light);
}

.breadcrumb a { color: var(--color-text-light); }
.breadcrumb a:hover { color: var(--color-primary); }

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.product-detail-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-badge-bg);
    border-radius: var(--radius);
    min-height: 400px;
    overflow: hidden;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 500px;
    display: block;
}

.img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--color-badge-bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.product-detail-info h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.product-sku {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.product-description {
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--color-text);
}

.product-description p {
    margin: 0 0 12px;
}

.product-description ul {
    margin: 0 0 12px;
    padding-left: 22px;
}

.product-description li {
    margin-bottom: 5px;
}

.product-description strong {
    color: var(--color-primary);
}

.pricing-table {
    margin-bottom: 20px;
}

.pricing-table h3 {
    margin-bottom: 8px;
}

.pricing-table table {
    width: 100%;
    border-collapse: collapse;
}

.pricing-table th,
.pricing-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.pricing-table th {
    background: var(--color-badge-bg);
    font-weight: 600;
    font-size: 0.85rem;
}

.pricing-table tr.highlighted {
    background: #fff8e1;
    font-weight: 700;
}

.your-price {
    margin-top: 8px;
    font-size: 1.1rem;
}

.login-to-purchase {
    margin: 16px 0;
    font-size: 0.95rem;
}

.stock-info {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.in-stock { color: var(--color-success); }
.out-of-stock { color: var(--color-error); }

.add-to-cart-form {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.qty-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-selector input[type="number"] {
    width: 80px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    text-align: center;
}

/* ─── Cart ───────────────────────────────────────────────────── */
.cart-page h1 { margin-bottom: 24px; }

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.cart-table th,
.cart-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.cart-table th {
    background: var(--color-badge-bg);
    font-weight: 600;
    font-size: 0.85rem;
}

.cart-table td { vertical-align: middle; }

.cart-qty input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-align: center;
}

.btn-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-error);
    padding: 4px 8px;
    border-radius: var(--radius);
}

.btn-remove:hover {
    background: #fde8e8;
}

.cart-summary {
    text-align: right;
    margin-top: 20px;
}

.cart-subtotal {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

/* ─── Checkout ───────────────────────────────────────────────── */
.checkout-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.checkout-page h1 { margin-bottom: 24px; }

.checkout-page h2 { margin-bottom: 16px; }
.checkout-page h3 {
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
}

.checkout-summary {
    background: var(--color-badge-bg);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    align-self: start;
    position: sticky;
    top: 80px;
}

.checkout-items {
    list-style: none;
    margin-bottom: 16px;
}

.checkout-items li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    gap: 8px;
}

.checkout-item-name {
    flex: 1 1 auto;
    min-width: 120px;
    word-break: break-word;
}

.checkout-item-qty {
    flex: 0 0 auto;
    text-align: center;
    color: var(--color-text-light);
    padding: 0 10px;
}

.checkout-item-price {
    flex: 0 0 auto;
    text-align: right;
    font-weight: 600;
    min-width: 60px;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 1rem;
}

.checkout-total.grand-total {
    font-size: 1.2rem;
    border-top: 2px solid var(--color-primary);
    padding-top: 12px;
    margin-top: 8px;
}

.checkout-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 16px 0;
    font-size: 0.9rem;
}

.checkout-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* ─── PayPal ─────────────────────────────────────────────────── */
.paypal-payment-section {
    max-width: 640px;
}

.payment-summary {
    margin-bottom: 30px;
}

.payment-totals {
    margin-top: 16px;
    text-align: right;
}

.total-amount {
    font-size: 1.3rem;
    margin-top: 8px;
}

.payment-method-section {
    background: var(--color-surface);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

#paypal-button-container {
    margin: 20px 0;
    min-height: 150px;
}

.payment-security {
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-align: center;
    margin-top: 16px;
}

/* Bank transfer payment option */
.bank-transfer-section {
    margin-top: 28px;
    background: var(--color-surface);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-info);
}

.bank-transfer-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.bank-transfer-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.bank-transfer-section h3 {
    margin-bottom: 4px;
    color: var(--color-primary);
    font-size: 1.05rem;
}

.bank-transfer-intro {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin: 0;
}

.bank-transfer-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg);
    border-radius: var(--radius);
    overflow: hidden;
}

.bank-transfer-table th,
.bank-transfer-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    text-align: left;
    vertical-align: middle;
}

.bank-transfer-table th {
    width: 38%;
    color: var(--color-text-light);
    font-weight: 600;
    white-space: nowrap;
    background: rgba(90, 62, 27, 0.04);
}

.bank-transfer-table td {
    color: var(--color-text);
    word-break: break-word;
}

.bank-transfer-table tr:last-child th,
.bank-transfer-table tr:last-child td {
    border-bottom: none;
}

.bank-code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 0.02em;
    margin-right: 10px;
}

.btn-copy {
    background: var(--color-badge-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.75rem;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-copy:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.bank-transfer-note {
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* ─── Order Detail ───────────────────────────────────────────── */
.order-detail-page .back-link {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.order-status-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.order-timeline,
.order-financials,
.order-addresses,
.order-tracking,
.order-notes {
    margin-bottom: 30px;
}

.order-addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.order-financials {
    text-align: right;
    font-size: 1rem;
}

.order-financials p { margin-bottom: 4px; }
.order-financials .total {
    font-size: 1.3rem;
    border-top: 2px solid var(--color-border);
    padding-top: 8px;
    margin-top: 8px;
}

/* ─── Timeline ───────────────────────────────────────────────── */
.timeline {
    list-style: none;
    border-left: 2px solid var(--color-border);
    padding-left: 20px;
}

.timeline li {
    padding: 8px 0;
    position: relative;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary-light);
    border: 2px solid var(--color-surface);
}

.timeline-date {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.timeline-status { font-size: 0.95rem; }

.timeline-actor,
.timeline-notes {
    font-size: 0.85rem;
    color: var(--color-text-light);
    display: block;
}

/* ─── Data Tables ────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.data-table th {
    background: var(--color-badge-bg);
    font-weight: 600;
    font-size: 0.85rem;
}

.data-table tbody tr:hover {
    background: #faf5ef;
}

.data-table .actions-cell {
    white-space: nowrap;
    width: 1%;
}
.data-table .actions-cell .btn {
    margin-right: 4px;
}

/* ─── Status Badges ──────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending_approval { background: #fff8e1; color: #b8860b; }
.status-approved_pending_payment { background: #fff3e0; color: #e65100; }
.status-approved { background: #e3f2fd; color: #1565c0; }
.status-pending_payment { background: #fff3e0; color: #e65100; }
.status-paid { background: #e8f5e9; color: #2e7d32; }
.status-in_delivery { background: #e3f2fd; color: #1565c0; }
.status-closed { background: #e8f5e9; color: #1b5e20; }
.status-shipped { background: #f3e5f5; color: #7b1fa2; }
.status-completed { background: #e8f5e9; color: #1b5e20; }
.status-cancelled { background: #fde8e8; color: #c62828; }
.status-pending { background: #fff8e1; color: #b8860b; }
.status-approved { background: #e3f2fd; color: #1565c0; }
.status-suspended { background: #fde8e8; color: #c62828; }

/* ─── Tier Badges ────────────────────────────────────────────── */
.tier-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tier-retailer { background: #e8f5e9; color: #2e7d32; }
.tier-tier1_distributor { background: #e3f2fd; color: #1565c0; }
.tier-tier2_distributor { background: #f3e5f5; color: #7b1fa2; }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 24px 0;
}

.page-link {
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--color-surface);
}

.page-link.active {
    background: var(--color-primary);
    color: #fff !important;
    border-color: var(--color-primary);
}

.page-link:hover:not(.active) {
    background: var(--color-badge-bg);
}

/* ─── Admin ──────────────────────────────────────────────────── */
.admin-page h1 { margin-bottom: 20px; }
.admin-page h2 { margin: 24px 0 12px; }

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

.admin-header h1 { margin-bottom: 0; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--color-border);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.stat-card.warning .stat-number { color: var(--color-warning); }
.stat-card.danger .stat-number { color: var(--color-error); }

.admin-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-filters .btn-sm.active {
    background: var(--color-primary);
    color: #fff !important;
    border-color: var(--color-primary);
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.admin-detail-card {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.admin-detail-card h3 {
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
}

.admin-detail-card p {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.admin-form-section {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    margin-bottom: 20px;
}

.admin-form-section h3 {
    margin-bottom: 16px;
    font-size: 1rem;
}

.approve-section {
    border-color: var(--color-success);
    border-width: 2px;
    background: linear-gradient(135deg, var(--color-surface) 0%, #f0fdf4 100%);
}

.approve-section h3 {
    color: var(--color-success);
}

.admin-form {
    max-width: 720px;
}

.admin-form h3 {
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
}

.spec-row {
    background: var(--color-surface);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    margin-bottom: 8px;
    align-items: end;
}

/* ─── Product table with expandable specs ─────────────── */
.product-table .expand-toggle {
    cursor: pointer;
    font-size: 0.85rem;
    user-select: none;
    transition: transform 0.15s;
}

.product-table .product-row {
    cursor: pointer;
}

.product-table .product-row:hover {
    background: #f5efe6;
}

.specs-row td {
    padding: 0 !important;
    background: #faf6f0;
}

.specs-inner {
    padding: 12px 20px 16px 40px;
}

.specs-inner h4 {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.specs-table th {
    background: #ede4d8;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--color-border);
}

.specs-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--color-border);
}

.specs-table .price {
    font-family: 'Consolas', monospace;
    text-align: right;
}

.specs-table .center {
    text-align: center;
}

.specs-table .mono {
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.inactive-row {
    opacity: 0.55;
}

.inactive-row td {
    text-decoration: line-through;
    font-style: italic;
}

/* ─── Spec form blocks (product edit page) ────────────── */
.spec-block {
    background: #f9f5ef;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.spec-block .spec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.spec-block .spec-title {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
}

/* ─── Image upload preview ────────────────────────────── */
.current-image {
    margin: 8px 0;
}

.current-image img {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 4px;
    background: #fff;
}

/* ─── Product detail spec pricing table ───────────────── */
.spec-pricing-table {
    margin: 16px 0;
}

.spec-pricing-table h3 {
    margin-bottom: 8px;
}

.spec-pricing-table table {
    width: 100%;
    border-collapse: collapse;
}

.spec-pricing-table th {
    background: #ede4d8;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
}

.spec-pricing-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
}

.spec-pricing-table .highlighted {
    background: #f0f7ee;
}

.spec-pricing-table .price-active {
    font-weight: 700;
    color: var(--color-primary);
}

.spec-pricing-table th.price-active {
    background: #e3d3bd;
}

.text-muted {
    color: var(--color-text-light);
    font-style: italic;
}

.hint {
    font-weight: normal;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.calculated-total {
    font-size: 1.2rem;
    text-align: right;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
    background: var(--color-badge-bg);
    border-radius: var(--radius);
    font-size: 16px;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* ─── Error Page ─────────────────────────────────────────────── */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-page h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.error-page p {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: 24px;
}

/* ─── Floating Cart Badge ─────────────────────────────────────── */
.floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c97b3a, #8b6b40);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(201, 123, 58, 0.4);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-cart:hover {
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(201, 123, 58, 0.5);
}

.floating-cart-icon {
    font-size: 24px;
    line-height: 1;
}

.floating-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: var(--color-error);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ─── Fly-to-Cart Animation Element ─────────────────────────── */


/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .shop-nav-inner {
        flex-direction: column;
        height: auto;
        padding: 10px 16px;
        gap: 8px;
    }

    .shop-nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .product-detail-layout {
        grid-template-columns: 1fr;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .form-row-2,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .order-addresses {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* ─── Modal Overlay ──────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-box .modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-box h2 {
    font-size: 22px;
    color: var(--color-primary);
    margin: 0 0 12px;
}

.modal-box p {
    font-size: 15px;
    color: var(--color-text);
    line-height: 1.6;
    margin: 0 0 8px;
}

.modal-box .modal-hint {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 24px;
}

.modal-box .btn {
    min-width: 140px;
}


.btn-sm.btn-danger {
    background: #c0392b;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-sm.btn-danger:hover {
    background: #a93226;
}

/* ─── PayPal Message ──────────────────────────────────────────── */
.paypal-message {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 12px 0;
    font-size: 0.9rem;
    text-align: center;
}

.paypal-message-error {
    background: #fde8e8;
    border: 1px solid #f5c6cb;
    color: var(--color-error);
}

.paypal-message-success {
    background: #e8f5e9;
    border: 1px solid #c3e6cb;
    color: var(--color-success);
}
