/* =====================================================
   All Products Section - Premium CSS
   Sri Sabari Crackers
   ===================================================== */

:root {
    --ap-primary: #ff6a00;
    --ap-primary-dark: #e55d00;
    --ap-primary-light: #ff8c40;
    --ap-secondary: #5a5c5b;
    --ap-accent: #FFD54F;
    --ap-white: #ffffff;
    --ap-bg: #f8f9fa;
    --ap-text: #333333;
    --ap-text-muted: #777777;
    --ap-border: #e8e8e8;
    --ap-success: #28a745;
    --ap-danger: #dc3545;
    --ap-green: #28a745;
    --ap-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --ap-shadow-hover: 0 12px 40px rgba(255, 106, 0, 0.15);
    --ap-radius: 16px;
    --ap-radius-sm: 10px;
    --ap-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ap-glass-bg: rgba(255, 255, 255, 0.85);
    --ap-glass-border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ---- Section Container ---- */
.ap-section {
    padding: 40px 0 60px;
    background: linear-gradient(180deg, #fff5ed 0%, #ffffff 30%);
    position: relative;
}

body.ap-modal-open {
    overflow: hidden !important;
}

.ap-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 106, 0, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ap-container {
    max-width: 1400px;
    padding: 0 20px;
}

/* ---- Section Header ---- */
.ap-section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--ap-secondary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.ap-section-subtitle {
    font-size: 1.05rem;
    color: var(--ap-text-muted);
    margin-bottom: 4px;
}

.ap-section-desc {
    font-size: 0.9rem;
    color: var(--ap-text-muted);
    margin-bottom: 0;
}

/* ---- Badges ---- */
.ap-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 4px;
    background: var(--ap-glass-bg);
    backdrop-filter: blur(10px);
    border: var(--ap-glass-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    color: var(--ap-secondary);
}

.ap-badge--factory { border-left: 3px solid var(--ap-primary); }
.ap-badge--shipping { border-left: 3px solid var(--ap-success); }
.ap-badge--quality { border-left: 3px solid var(--ap-accent); }
.ap-badge--wholesale { border-left: 3px solid #6c5ce7; }

/* ---- Search Box ---- */
.ap-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--ap-white);
    border: 2px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    padding: 0 16px;
    transition: var(--ap-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ap-search-box:focus-within {
    border-color: var(--ap-primary);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}

.ap-search-box i {
    color: var(--ap-text-muted);
    font-size: 1rem;
}

.ap-search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px;
    font-size: 0.95rem;
    background: transparent;
    color: var(--ap-text);
}

.ap-search-box input::placeholder {
    color: #aaa;
}

.ap-search-clear {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--ap-text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.ap-search-clear:hover {
    color: var(--ap-danger);
}

/* ---- Category Filter Pills ---- */
.ap-category-filter-wrap {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ap-category-filter-wrap::-webkit-scrollbar {
    display: none;
}

.ap-category-pills {
    display: contents;
}

.ap-category-pill {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 50px;
    border: 2px solid var(--ap-border);
    background: var(--ap-white);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ap-secondary);
    cursor: pointer;
    transition: var(--ap-transition);
    flex-shrink: 0;
}

.ap-category-pill:hover {
    border-color: var(--ap-primary);
    color: var(--ap-primary);
}

.ap-pill-active,
.ap-category-pill.ap-pill-active {
    background: linear-gradient(135deg, var(--ap-primary), var(--ap-primary-light));
    color: var(--ap-white);
    border-color: var(--ap-primary);
}

/* ---- Sort Select ---- */
.ap-sort-select {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    background: var(--ap-white);
    font-size: 0.9rem;
    color: var(--ap-text);
    cursor: pointer;
    outline: none;
    transition: var(--ap-transition);
    appearance: auto;
}

.ap-sort-select:focus {
    border-color: var(--ap-primary);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}

/* ---- Results Count ---- */
.ap-results-count {
    padding: 10px 0;
    font-size: 0.9rem;
    color: var(--ap-text-muted);
    font-weight: 600;
}

.ap-results-count span {
    color: var(--ap-primary);
    font-weight: 700;
}

/* ---- Loading ---- */
.ap-loading {
    text-align: center;
    padding: 60px 20px;
}

.ap-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--ap-border);
    border-top-color: var(--ap-primary);
    border-radius: 50%;
    animation: apSpin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.ap-loading p {
    color: var(--ap-text-muted);
    font-size: 0.95rem;
}

/* ---- Category Card ---- */
.ap-category-card {
    background: var(--ap-white);
    border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: var(--ap-transition);
    animation: apFadeInUp 0.5s ease forwards;
    opacity: 0;
}

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

.ap-category-card:hover {
    box-shadow: var(--ap-shadow-hover);
}

.ap-category-header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.03), rgba(255, 106, 0, 0.08));
    border-bottom: 1px solid rgba(255, 106, 0, 0.1);
    transition: var(--ap-transition);
}

.ap-category-header:hover {
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.06), rgba(255, 106, 0, 0.12));
}

.ap-category-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ap-primary), var(--ap-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-right: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.25);
}

.ap-category-name {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ap-secondary);
    margin: 0;
}

.ap-category-count {
    background: var(--ap-primary);
    color: var(--ap-white);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    margin-right: 12px;
}

.ap-category-chevron {
    font-size: 1.2rem;
    color: var(--ap-text-muted);
    transition: transform 0.3s ease;
}

.ap-category-card.ap-collapsed .ap-category-chevron {
    transform: rotate(-90deg);
}

.ap-category-body {
    max-height: 50000px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.ap-category-card.ap-collapsed .ap-category-body {
    max-height: 0;
    overflow: hidden;
}

/* ---- Product Table ---- */
.ap-product-table {
    width: 100%;
    border-collapse: collapse;
}

.ap-product-table thead th {
    padding: 12px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ap-text-muted);
    background: #fafafa;
    border-bottom: 2px solid var(--ap-border);
    text-align: left;
    white-space: nowrap;
}

.ap-product-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: var(--ap-transition);
}

.ap-product-table tbody tr:hover {
    background: rgba(255, 106, 0, 0.03);
    transform: scale(1.002);
}

.ap-product-table tbody tr:last-child {
    border-bottom: none;
}

.ap-product-table td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Product Image */
.ap-prod-img-wrap {
    width: 140px;
    height: 140px;
    border-radius: var(--ap-radius);
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    border: 2px solid var(--ap-border);
    transition: var(--ap-transition);
}

.ap-prod-img-wrap:hover {
    border-color: var(--ap-primary);
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(255, 106, 0, 0.2);
}

.ap-prod-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info */
.ap-prod-name {
    font-weight: 700;
    color: var(--ap-secondary);
    margin: 0;
    font-size: 0.92rem;
    cursor: pointer;
}

.ap-prod-name:hover {
    color: var(--ap-primary);
}

.ap-prod-code {
    font-size: 0.75rem;
    color: var(--ap-text-muted);
    margin: 2px 0 0;
}

.ap-prod-unit {
    font-size: 0.73rem;
    color: var(--ap-text-muted);
}

/* Badges */
.ap-prod-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.ap-prod-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.ap-prod-badge--new {
    background: #e3f2fd;
    color: #1976d2;
}

.ap-prod-badge--best {
    background: #fff3e0;
    color: #f57c00;
}

.ap-prod-badge--featured {
    background: #fce4ec;
    color: #c62828;
}

.ap-prod-badge--top {
    background: #e8f5e9;
    color: #388e3c;
}

/* Price */
.ap-price-old {
    text-decoration: line-through;
    color: #aaa;
    font-size: 0.82rem;
    display: block;
}

.ap-price-new {
    color: var(--ap-primary);
    font-weight: 800;
    font-size: 1.05rem;
}

.ap-price-discount {
    display: inline-block;
    background: var(--ap-green);
    color: var(--ap-white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* Stock Status */
.ap-stock-in {
    color: var(--ap-green);
    font-weight: 600;
    font-size: 0.82rem;
}

.ap-stock-out {
    color: var(--ap-danger);
    font-weight: 600;
    font-size: 0.82rem;
}

/* Quantity Selector */
.ap-qty-selector {
    display: flex;
    align-items: center;
    border: 2px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    overflow: hidden;
    background: var(--ap-white);
}

.ap-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ap-secondary);
    cursor: pointer;
    transition: var(--ap-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-qty-btn:hover {
    background: var(--ap-primary);
    color: var(--ap-white);
}

.ap-qty-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--ap-border);
    border-right: 1px solid var(--ap-border);
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ap-text);
    outline: none;
    -moz-appearance: textfield;
}

.ap-qty-input::-webkit-outer-spin-button,
.ap-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Total Price */
.ap-total-price {
    font-weight: 800;
    color: var(--ap-secondary);
    font-size: 1rem;
}

/* Action Buttons */
.ap-action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ap-btn-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--ap-radius-sm);
    background: linear-gradient(135deg, var(--ap-primary), var(--ap-primary-light));
    color: var(--ap-white);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--ap-transition);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.25);
}

.ap-btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 106, 0, 0.35);
}

.ap-btn-add.ap-added {
    background: var(--ap-green);
}

.ap-btn-icon {
    width: 34px;
    height: 34px;
    border: 2px solid var(--ap-border);
    border-radius: 8px;
    background: var(--ap-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--ap-transition);
    color: var(--ap-text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ap-btn-icon:hover {
    border-color: var(--ap-primary);
    color: var(--ap-primary);
    background: rgba(255, 106, 0, 0.05);
}

/* ---- Cart Summary (Desktop) ---- */
.ap-cart-summary {
    position: sticky;
    top: 80px;
    background: var(--ap-white);
    border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow);
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 50;
    transition: box-shadow 0.3s ease;
}

.ap-cart-summary:hover {
    box-shadow: var(--ap-shadow-hover);
}

.ap-cart-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ap-secondary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ap-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ap-cart-items-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.ap-empty-cart {
    text-align: center;
    color: var(--ap-text-muted);
    font-size: 0.85rem;
    padding: 20px 0;
}

.ap-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.82rem;
}

.ap-cart-item:last-child {
    border-bottom: none;
}

.ap-cart-item-img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}

.ap-cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-cart-item-info {
    flex: 1;
    min-width: 0;
}

.ap-cart-item-name {
    font-weight: 600;
    color: var(--ap-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-cart-item-qty {
    color: var(--ap-text-muted);
    font-size: 0.75rem;
}

.ap-cart-item-price {
    font-weight: 700;
    color: var(--ap-primary);
    white-space: nowrap;
}

.ap-cart-item-remove {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    transition: var(--ap-transition);
}

.ap-cart-item-remove:hover {
    color: var(--ap-danger);
}

/* Cart Totals */
.ap-cart-totals {
    border-top: 2px solid var(--ap-border);
    padding-top: 12px;
}

/* Minimum Order Warning */
.ap-min-order-warning {
    margin-top: 12px;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--ap-radius-sm);
    font-size: 0.82rem;
    color: #856404;
}

.ap-min-order-warning i {
    margin-right: 4px;
    color: #e6a800;
}

.ap-min-order-progress {
    margin-top: 8px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.ap-min-order-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--ap-primary), var(--ap-accent));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.ap-min-order-reached {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.ap-min-order-reached .ap-min-order-warning i {
    color: #28a745;
}

.ap-cart-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.88rem;
    color: var(--ap-text-muted);
}

.ap-cart-row--savings span:last-child {
    color: var(--ap-green);
    font-weight: 600;
}

.ap-cart-row--total {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ap-secondary);
    border-top: 2px solid var(--ap-border);
    margin-top: 8px;
    padding-top: 10px;
}

.ap-cart-row--total span:last-child {
    color: var(--ap-primary);
}

.ap-text-green {
    color: var(--ap-green);
}

/* Cart Actions */
.ap-cart-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--ap-radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--ap-transition);
    text-align: center;
}

.ap-btn--continue {
    background: var(--ap-white);
    border: 2px solid var(--ap-border);
    color: var(--ap-secondary);
}

.ap-btn--continue:hover {
    border-color: var(--ap-primary);
    color: var(--ap-primary);
}

.ap-btn--clear {
    background: var(--ap-white);
    border: 2px solid var(--ap-border);
    color: var(--ap-text-muted);
}

.ap-btn--clear:hover {
    border-color: var(--ap-danger);
    color: var(--ap-danger);
}

.ap-btn--order {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: var(--ap-white);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

.ap-btn--order:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
}

.ap-btn--order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ap-btn--add {
    background: linear-gradient(135deg, var(--ap-primary), var(--ap-primary-light));
    color: var(--ap-white);
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.25);
}

.ap-btn--add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 106, 0, 0.35);
}

.ap-btn--lg {
    padding: 10px 24px;
    font-size: 0.95rem;
}

/* ---- Mobile Floating Cart ---- */
.ap-mobile-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--ap-white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 2px solid var(--ap-primary);
}

.ap-mobile-cart-inner {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
}

.ap-mobile-cart-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.ap-mobile-cart-icon {
    position: relative;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--ap-primary), var(--ap-primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ap-white);
    font-size: 1.1rem;
}

.ap-mobile-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--ap-green);
    color: var(--ap-white);
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-mobile-cart-items {
    font-size: 0.85rem;
    color: var(--ap-text-muted);
}

.ap-mobile-cart-total {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ap-secondary);
    margin-right: 12px;
}

.ap-mobile-cart-order {
    padding: 10px 18px;
    border: none;
    border-radius: var(--ap-radius-sm);
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: var(--ap-white);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.ap-mobile-cart-order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Mobile Summary Overlay ---- */
.ap-mobile-summary-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: apFadeIn 0.2s ease;
}

@keyframes apFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ap-mobile-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: var(--ap-white);
    border-radius: 20px 20px 0 0;
    z-index: 1001;
    overflow-y: auto;
    animation: apSlideUp 0.3s ease;
}

@keyframes apSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.ap-mobile-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ap-border);
    position: sticky;
    top: 0;
    background: var(--ap-white);
}

.ap-mobile-summary-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ap-secondary);
}

.ap-mobile-summary-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--ap-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ap-mobile-summary-body {
    padding: 16px 20px;
}

/* ---- Modals ---- */
.ap-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: apFadeIn 0.2s ease;
}

.ap-modal {
    background: var(--ap-white);
    border-radius: var(--ap-radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: apScaleIn 0.3s ease;
}

@keyframes apScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ap-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--ap-border);
    position: sticky;
    top: 0;
    background: var(--ap-white);
    z-index: 1;
}

.ap-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ap-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ap-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--ap-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ap-modal-close:hover {
    color: var(--ap-danger);
}

.ap-modal-body {
    padding: 20px 24px;
}

.ap-modal-order-summary {
    background: #f9f9f9;
    border-radius: var(--ap-radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.ap-modal-order-summary h4 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ap-secondary);
}

/* ---- Order Form ---- */
.ap-order-form h4 {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ap-secondary);
}

.ap-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.ap-form-group {
    margin-bottom: 12px;
}

.ap-form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ap-secondary);
    margin-bottom: 4px;
}

.ap-required {
    color: var(--ap-danger);
}

.ap-form-group input,
.ap-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    font-size: 0.9rem;
    color: var(--ap-text);
    outline: none;
    transition: var(--ap-transition);
    font-family: inherit;
}

.ap-form-group input:focus,
.ap-form-group textarea:focus {
    border-color: var(--ap-primary);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}

.ap-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.ap-btn--cancel {
    flex: 1;
    background: var(--ap-white);
    border: 2px solid var(--ap-border);
    color: var(--ap-text-muted);
}

.ap-btn--cancel:hover {
    border-color: var(--ap-danger);
    color: var(--ap-danger);
}

.ap-btn--whatsapp {
    flex: 2;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: var(--ap-white);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

.ap-btn--whatsapp:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
}

/* ---- Quick View Modal ---- */
.ap-modal--quickview {
    max-width: 700px;
}

.ap-qv-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.ap-qv-image {
    border-radius: var(--ap-radius-sm);
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1;
}

.ap-qv-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-qv-info h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ap-secondary);
}

.ap-qv-code {
    font-size: 0.8rem;
    color: var(--ap-text-muted);
    margin: 0 0 8px;
}

.ap-qv-prices {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ap-qv-offer {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--ap-primary);
}

.ap-qv-original {
    font-size: 0.9rem;
    text-decoration: line-through;
    color: #aaa;
}

.ap-qv-discount {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--ap-green);
    color: var(--ap-white);
}

.ap-qv-stock {
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.ap-qv-desc {
    font-size: 0.85rem;
    color: var(--ap-text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.ap-qv-add {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ---- Toast ---- */
.ap-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ap-secondary);
    color: var(--ap-white);
    padding: 12px 24px;
    border-radius: var(--ap-radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.ap-toast.ap-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ap-toast.ap-toast--success {
    background: var(--ap-green);
}

.ap-toast.ap-toast--error {
    background: var(--ap-danger);
}

/* ---- Empty State ---- */
.ap-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ap-text-muted);
}

.ap-empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
    color: #ddd;
}

.ap-empty-state h4 {
    margin-bottom: 8px;
    color: var(--ap-secondary);
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .ap-section-title {
        font-size: 1.6rem;
    }

    .ap-form-row {
        grid-template-columns: 1fr;
    }

    .ap-qv-body {
        grid-template-columns: 1fr;
    }

    .ap-modal--quickview {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .ap-section {
        padding: 24px 0 80px;
    }

    .ap-section-title {
        font-size: 1.3rem;
    }

    .ap-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .ap-product-table thead {
        display: none;
    }

    .ap-product-table,
    .ap-product-table tbody,
    .ap-product-table tr,
    .ap-product-table td {
        display: block;
    }

    .ap-product-table tbody tr {
        padding: 12px 16px;
        background: var(--ap-white);
        margin-bottom: 8px;
        border-radius: var(--ap-radius-sm);
        border: 1px solid var(--ap-border);
    }

    .ap-category-body {
        max-height: none;
        overflow: visible;
    }

    .ap-product-table td {
        padding: 4px 0;
        border: none;
    }

    .ap-product-table td:nth-child(1) {
        display: block;
        margin-bottom: 12px;
    }

    .ap-product-table td:nth-child(2)::before { content: ''; }

    .ap-prod-img-wrap {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        max-height: 300px;
        border-radius: var(--ap-radius);
    }

    .ap-prod-img-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .ap-action-btns {
        flex-wrap: wrap;
        margin-top: 8px;
        gap: 8px;
    }

    .ap-qty-selector {
        display: flex;
        width: 100%;
        border-radius: var(--ap-radius);
        border: 2px solid var(--ap-primary);
    }

    .ap-qty-btn {
        width: 50%;
        height: 48px;
        font-size: 1.4rem;
        flex: 1;
    }

    .ap-qty-input {
        width: 60px;
        height: 48px;
        font-size: 1.1rem;
        border-left: 2px solid var(--ap-primary);
        border-right: 2px solid var(--ap-primary);
    }

    .ap-btn-add {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }

    .ap-category-header {
        padding: 12px 16px;
    }

    .ap-category-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        margin-right: 10px;
    }

    .ap-category-name {
        font-size: 0.9rem;
    }

    .ap-mobile-cart {
        display: block !important;
    }

    .ap-cart-summary {
        display: none;
    }

    .ap-modal {
        margin: 10px;
        max-height: 95vh;
    }

    .ap-modal-actions {
        flex-direction: column;
    }

    .ap-btn--whatsapp,
    .ap-btn--cancel {
        flex: none;
        width: 100%;
    }
}

@media (min-width: 768px) {
    .ap-mobile-cart {
        display: none !important;
    }
}

/* ---- No Results ---- */
.ap-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--ap-text-muted);
}

.ap-no-results h4 {
    color: var(--ap-secondary);
    margin-bottom: 8px;
}

/* ---- Login Modal ---- */
.ap-modal--login {
    max-width: 420px;
}

.ap-login-msg {
    font-size: 0.9rem;
    color: var(--ap-text-muted);
    margin-bottom: 20px;
    text-align: center;
}

.ap-login-error {
    display: none;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px 14px;
    border-radius: var(--ap-radius-sm);
    font-size: 0.85rem;
    margin-top: 12px;
}

.ap-login-error.ap-login-error--show {
    display: block;
}

.ap-login-alt {
    text-align: center;
    font-size: 0.82rem;
    color: var(--ap-text-muted);
    margin-top: 16px;
}

.ap-login-alt a {
    color: var(--ap-primary);
    text-decoration: none;
    font-weight: 600;
}

.ap-login-alt a:hover {
    text-decoration: underline;
}

.ap-input--readonly {
    background: #f8f9fa !important;
    cursor: not-allowed;
}

/* ---- Header Cart Badge Bounce ---- */
@keyframes ap-badge-bounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.5); }
    60% { transform: scale(0.85); }
    100% { transform: scale(1); }
}

.ap-badge-bounce {
    animation: ap-badge-bounce 0.4s ease;
    display: inline-block;
    background: #ff6a00 !important;
    color: #fff !important;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 4px;
    transition: transform 0.3s ease;
}

#header_cart_load {
    transition: opacity 0.25s ease;
}

/* ---- Coupon ---- */
.ap-coupon-wrap {
    margin-bottom: 12px;
}

.ap-coupon-input-group {
    display: flex;
    gap: 6px;
}

.ap-coupon-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.ap-coupon-input:focus {
    border-color: var(--ap-primary);
}

.ap-coupon-apply-btn {
    padding: 8px 14px;
    background: var(--ap-primary);
    color: #fff;
    border: none;
    border-radius: var(--ap-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ap-coupon-apply-btn:hover {
    background: var(--ap-primary-dark);
}

.ap-coupon-msg {
    font-size: 0.8rem;
    margin-top: 4px;
    min-height: 18px;
}

.ap-coupon-msg--success {
    color: var(--ap-green);
}

.ap-coupon-msg--error {
    color: var(--ap-danger);
}

/* ---- Radio Options ---- */
.ap-radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.9rem;
}

.ap-radio-option input[type="radio"] {
    accent-color: var(--ap-primary);
    width: 16px;
    height: 16px;
}

/* ---- Checkout Fields ---- */
.ap-checkout-divider {
    border-top: 1px solid var(--ap-border);
    margin: 14px 0;
}

.ap-checkout-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ap-secondary);
    margin-bottom: 8px;
    display: block;
}

.ap-bank-details,
.ap-online-payment-msg {
    background: #f9f9f9;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--ap-text-muted);
    line-height: 1.5;
}

.ap-bank-description {
    background: #fff3e0;
    border-left: 3px solid var(--ap-primary);
    border-radius: var(--ap-radius-sm);
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.82rem;
    color: var(--ap-text);
    line-height: 1.6;
}

.ap-privacy-text {
    margin-top: 10px;
    font-size: 0.72rem;
    color: var(--ap-text-muted);
    line-height: 1.4;
}

.ap-privacy-text a {
    color: var(--ap-primary);
    text-decoration: underline;
}

/* ---- Customer Panel ---- */
.ap-customer-panel .ap-form-group {
    margin-bottom: 10px;
}

.ap-customer-panel label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ap-text);
    margin-bottom: 3px;
    display: block;
}

.ap-customer-panel input,
.ap-customer-panel textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.ap-customer-panel input:focus,
.ap-customer-panel textarea:focus {
    border-color: var(--ap-primary);
}

.ap-btn--full {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.ap-btn--whatsapp {
    background: #25D366;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: var(--ap-radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.ap-btn--whatsapp:hover {
    background: #1ebe5d;
}
