/* ==========================================================================
   SHREE MATA — SHARED CUSTOMER COMPONENTS
   Buttons, Forms, Cards, Tables, Modals, Badges, Tabs, Skeletons, Alerts
   ========================================================================== */

/* ── 1. BUTTONS ── */
.btn-primary {
    background: var(--sm-ink);
    color: var(--sm-surface-pure);
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-align: center;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--sm-navy);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 24, 32, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--sm-bg);
    color: var(--sm-ink);
    border: 1px solid var(--sm-border);
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--sm-surface-muted);
    border-color: var(--sm-gold-muted);
    color: var(--sm-ink);
}

.btn-gold {
    background: var(--sm-gold);
    color: var(--sm-ink);
    font-size: 13.5px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.btn-gold:hover {
    background: var(--sm-gold-soft);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 167, 44, 0.25);
}

.btn-outline {
    background: transparent;
    color: var(--sm-ink);
    border: 1px solid var(--sm-border);
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-outline:hover {
    border-color: var(--sm-ink);
    background: var(--sm-bg);
}

.btn-disabled {
    background: #E2E8F0 !important;
    color: #94A3B8 !important;
    border-color: transparent !important;
    cursor: not-allowed !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 10px 18px !important;
    border-radius: var(--radius-sm) !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-danger {
    background: var(--sm-danger);
    color: var(--sm-surface-pure);
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-danger:hover {
    background: #B91C1C;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
}

.btn-full {
    width: 100%;
}

.btn-pill {
    border-radius: var(--radius-full);
}

/* ── 2. FORM CONTROLS ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.form-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sm-ink);
}

.form-label-optional {
    font-size: 12px;
    font-weight: 400;
    color: var(--sm-muted);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: var(--sm-surface-pure);
    border: 1px solid var(--sm-border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 14.5px;
    color: var(--sm-ink);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--sm-gold);
    box-shadow: 0 0 0 3px rgba(212, 167, 44, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--sm-muted);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-helper {
    font-size: 12px;
    color: var(--sm-muted);
}

.form-error {
    font-size: 12px;
    color: var(--sm-danger);
    font-weight: 500;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 1px solid var(--sm-border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    accent-color: var(--sm-navy);
}

.form-check-label {
    font-size: 14px;
    color: var(--sm-body);
}

/* ── 3. CARDS & SURFACES ── */
.sm-card {
    background: var(--sm-surface-pure);
    border: 1px solid var(--sm-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 24px;
    transition: all var(--transition-smooth);
}

.sm-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(212, 167, 44, 0.35);
}

.sm-card-header {
    border-bottom: 1px solid var(--sm-border-light);
    padding-bottom: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sm-card-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--sm-ink);
}

.sm-card-footer {
    border-top: 1px solid var(--sm-border-light);
    padding-top: 16px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ── 4. PRODUCT CARDS & PRICING ── */
.book-card {
    background: var(--sm-surface-pure);
    border: 1px solid var(--sm-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(212, 167, 44, 0.45);
}

.book-image-container {
    width: 100%;
    height: 230px;
    background: var(--sm-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--sm-border);
    margin-bottom: 16px;
}

.book-cover {
    height: 195px;
    width: auto;
    object-fit: contain;
    border-radius: 2px 6px 6px 2px;
    box-shadow: var(--shadow-book);
    transition: transform var(--transition-smooth);
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

.book-card h3 {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--sm-ink);
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 46px;
}

.book-author {
    font-size: 13px;
    color: var(--sm-muted);
    margin-bottom: 12px;
}

/* Master Unified Price Typography (Functional Clean Sans-Serif) */
.book-price,
.bundle-price-current,
.bundle-price,
.catalog-book-price,
.product-price,
.cart-price,
.order-price,
.order-item-price,
.total-price,
.subtotal-price,
.checkout-price,
.invoice-price,
.price,
.amount,
.money,
.digital-price,
.unit-price,
.stat-amount,
.reward-amount,
.wallet-amount,
.commission-amount {
    font-family: var(--sm-price-font) !important;
    font-size: var(--font-size-price, 20px) !important;
    font-weight: 700;
    color: var(--sm-ink);
    line-height: 1.2;
    margin-bottom: 14px;
    font-variant-numeric: tabular-nums;
}

.bundle-price-mrp,
.original-price,
.price-old,
.book-price-old,
.mrp-price {
    font-family: var(--sm-price-font) !important;
    font-size: 14px;
    color: var(--sm-muted);
    text-decoration: line-through;
    font-variant-numeric: tabular-nums;
}

.bundle-save-amt,
.save-badge,
.savings-amount {
    font-family: var(--sm-price-font) !important;
    font-variant-numeric: tabular-nums;
}

.book-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
}

/* ── 5. BADGES, CHIPS & STATUS TAGS ── */
.badge-success {
    background: var(--sm-success-bg);
    color: var(--sm-success);
    border: 1px solid var(--sm-success-border);
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.badge-danger {
    background: var(--sm-danger-bg);
    color: var(--sm-danger);
    border: 1px solid var(--sm-danger-border);
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.badge-warning {
    background: var(--sm-warning-bg);
    color: var(--sm-warning);
    border: 1px solid var(--sm-warning-border);
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.stock-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3.5px 9px;
    border-radius: var(--radius-sm);
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
}

.stock-overlay.out-of-stock {
    background: var(--sm-danger-bg);
    color: var(--sm-danger);
    border: 1px solid var(--sm-danger-border);
}

.stock-overlay.limited-stock {
    background: var(--sm-warning-bg);
    color: var(--sm-warning);
    border: 1px solid var(--sm-warning-border);
}

.cashback-sticker {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--sm-success-bg);
    color: var(--sm-success);
    border: 1px solid var(--sm-success-border);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
}

.chip-filter {
    background: var(--sm-bg);
    border: 1px solid var(--sm-border);
    color: var(--sm-ink);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip-filter:hover,
.chip-filter.active {
    background: var(--sm-ink);
    color: var(--sm-surface-pure);
    border-color: var(--sm-ink);
}

/* ── 6. TABS ── */
.tabs-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--sm-border);
    margin-bottom: 28px;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 20px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--sm-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--sm-ink);
}

.tab-btn.active {
    color: var(--sm-navy);
    border-bottom-color: var(--sm-gold);
    font-weight: 700;
}

/* ── 7. DATA TABLES ── */
.sm-table-wrap {
    background: var(--sm-surface-pure);
    border: 1px solid var(--sm-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    margin-bottom: 28px;
}

.sm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.sm-table th {
    background: var(--sm-surface-warm);
    color: var(--sm-ink);
    font-weight: 700;
    padding: 14px 20px;
    border-bottom: 1px solid var(--sm-border);
    letter-spacing: 0.02em;
}

.sm-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--sm-border-light);
    color: var(--sm-body);
}

.sm-table tr:last-child td {
    border-bottom: none;
}

.sm-table tr:hover td {
    background: rgba(247, 243, 234, 0.4);
}

/* ── 8. ALERTS & NOTICES ── */
.alert-box {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.alert-success {
    background: var(--sm-success-bg);
    color: var(--sm-success);
    border: 1px solid var(--sm-success-border);
}

.alert-danger {
    background: var(--sm-danger-bg);
    color: var(--sm-danger);
    border: 1px solid var(--sm-danger-border);
}

.alert-warning {
    background: var(--sm-warning-bg);
    color: var(--sm-warning);
    border: 1px solid var(--sm-warning-border);
}

/* ── 9. MODALS ── */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(16, 24, 32, 0.65);
    backdrop-filter: blur(4px);
    padding: 20px;
}

.modal.show,
.modal[style*="display: block"],
.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: var(--sm-surface-pure);
    border: 1px solid var(--sm-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 24px 28px 18px;
    border-bottom: 1px solid var(--sm-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title,
.modal-header h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--sm-ink);
}

.close,
.modal-close {
    font-size: 24px;
    color: var(--sm-muted);
    cursor: pointer;
    line-height: 1;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    transition: all var(--transition-fast);
}

.close:hover,
.modal-close:hover {
    color: var(--sm-ink);
    background: var(--sm-bg);
}

.modal-body {
    padding: 24px 28px;
}

.modal-footer {
    padding: 16px 28px 24px;
    border-top: 1px solid var(--sm-border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ── 10. PAGINATION ── */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding: 18px 24px;
    background: var(--sm-surface-pure);
    border: 1px solid var(--sm-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    font-size: 14px;
    font-weight: 500;
    color: var(--sm-muted);
}

.pagination-controls,
.page-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    background: var(--sm-bg);
    border: 1px solid var(--sm-border);
    color: var(--sm-ink);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--sm-ink);
    color: var(--sm-surface-pure);
    border-color: var(--sm-ink);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sm-ink);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-number:hover {
    background: var(--sm-bg);
}

.page-number.active {
    background: var(--sm-ink);
    color: var(--sm-surface-pure);
}

/* ── 11. EMPTY STATES ── */
.sm-empty-state {
    text-align: center;
    padding: 64px 24px;
    background: var(--sm-surface-pure);
    border: 1px solid var(--sm-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    max-width: 580px;
    margin: 40px auto;
}

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

.empty-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--sm-ink);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14.5px;
    color: var(--sm-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ── 12. SKELETON LOADERS & SPINNERS ── */
.skeleton-card {
    background: var(--sm-surface-pure);
    border: 1px solid var(--sm-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skeleton-thumb {
    width: 100%;
    height: 230px;
    background: linear-gradient(90deg, var(--sm-bg) 25%, #EFE9DC 50%, var(--sm-bg) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, var(--sm-bg) 25%, #EFE9DC 50%, var(--sm-bg) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: var(--radius-xs);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner-loading {
    width: 38px;
    height: 38px;
    border: 3px solid var(--sm-border);
    border-top-color: var(--sm-gold);
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
    margin: 32px auto;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}
