/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    border: none;
    text-decoration: none;
}
.btn-red {
    background: var(--primary-red);
    color: var(--white);
}
.btn-red:hover { background: var(--primary-red-dark); transform: translateY(-1px); }
.btn-blue {
    background: var(--primary-blue);
    color: var(--white);
}
.btn-blue:hover { background: var(--primary-blue-dark); transform: translateY(-1px); }
.btn-white {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--gray-200);
}
.btn-white:hover { border-color: var(--gray-400); background: var(--gray-50); }
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
}
.btn-outline:hover { background: var(--primary-red); color: var(--white); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--gray-100); color: var(--text-dark); }
.btn-sm { padding: 8px 16px; font-size: var(--text-xs); }
.btn-lg { padding: 16px 32px; font-size: var(--text-base); }
.btn-full { width: 100%; }
.btn-round { border-radius: var(--radius-full); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ===== Cards ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-body { padding: var(--space-md); }
.card-img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}
.card-flat { box-shadow: none; border: 1px solid var(--gray-200); }
.card-flat:hover { box-shadow: var(--shadow-sm); }

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}
.badge-red { background: var(--primary-red-light); color: var(--primary-red); }
.badge-blue { background: var(--primary-blue-light); color: var(--primary-blue); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-yellow { background: var(--warning-light); color: var(--warning); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ===== Input / Form ===== */
.input-group { margin-bottom: var(--space-md); }
.input-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--space-xs);
    color: var(--gray-700);
}
.input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    font-size: var(--text-base);
    color: var(--text-dark);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 32, 159, 0.1);
}
.input::placeholder { color: var(--gray-400); }
.input-icon {
    position: relative;
}
.input-icon .input { padding-left: 44px; }
.input-icon svg, .input-icon .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    width: 20px;
    height: 20px;
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 16px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-xl);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-bar:focus-within {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 32, 159, 0.1);
}
.search-bar input {
    flex: 1;
    background: none;
    font-size: var(--text-sm);
}
.search-bar svg { color: var(--gray-400); flex-shrink: 0; }

/* ===== Rating Stars ===== */
.rating {
    display: flex;
    align-items: center;
    gap: 2px;
}
.rating .star { color: var(--warning); font-size: var(--text-sm); }
.rating .star-empty { color: var(--gray-300); }
.rating-text { margin-left: 6px; font-size: var(--text-xs); color: var(--text-muted); }

/* ===== Avatar ===== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--gray-200);
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 72px; height: 72px; }

/* ===== Divider ===== */
.divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-md) 0;
}

/* ===== Section ===== */
.section {
    padding: var(--space-xl) 0;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}
.section-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-dark);
}
.section-link {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--primary-red);
}

/* ===== Status Stepper ===== */
.stepper {
    display: flex;
    align-items: flex-start;
    gap: 0;
}
.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.step-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    font-size: 12px;
    color: var(--white);
}
.step.active .step-dot { background: var(--primary-blue); }
.step.done .step-dot { background: var(--success); }
.step-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
}
.step.active .step-label, .step.done .step-label { color: var(--text-dark); font-weight: 500; }
.step::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--gray-200);
}
.step:last-child::after { display: none; }
.step.done::after { background: var(--success); }

/* ===== Toggle Switch ===== */
.toggle {
    position: relative;
    width: 48px;
    height: 28px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.toggle.active { background: var(--success); }
.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}
.toggle.active::after { transform: translateX(20px); }

/* ===== Quantity Control ===== */
.qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    color: var(--gray-600);
    background: var(--gray-50);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.qty-btn:hover { background: var(--gray-200); }
.qty-value {
    width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: var(--text-sm);
}

/* ===== Price Display ===== */
.price {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-dark);
}
.price-lg { font-size: var(--text-2xl); }
.price-sm { font-size: var(--text-sm); }
.price-old {
    text-decoration: line-through;
    color: var(--gray-400);
    font-weight: 400;
    margin-left: 6px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
}
.empty-state svg { margin: 0 auto var(--space-md); color: var(--gray-300); }
.empty-state h3 { margin-bottom: var(--space-sm); }
.empty-state p { color: var(--text-muted); font-size: var(--text-sm); margin-bottom: var(--space-lg); }

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Toast / Notification ===== */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: var(--gray-800);
    color: var(--white);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transition: all var(--transition-normal);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== Modal / Overlay ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 5000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding: var(--space-lg);
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-md);
}

@media (min-width: 768px) {
    .modal-overlay { align-items: center; }
    .modal {
        border-radius: var(--radius-xl);
        transform: translateY(20px) scale(0.95);
    }
    .modal-overlay.show .modal { transform: translateY(0) scale(1); }
}
