/* ============================================
   DZ Shop - Clean UI System
   Simple, Modern, Mobile-First
   Version: 2.0
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows - Minimal */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* ============================================
   REUSABLE LAYOUT CLASSES
   ============================================ */
.section {
    padding: var(--space-xl) 0;
}

@media (min-width: 768px) {
    .section {
        padding: var(--space-3xl) 0;
    }
}

.section-compact {
    padding: var(--space-lg) 0;
}

@media (min-width: 768px) {
    .section-compact {
        padding: var(--space-2xl) 0;
    }
}

/* ============================================
   PRODUCT GRID - RESPONSIVE
   Mobile: 2 cols, 2 rows (4 products max)
   Tablet: 3 cols
   Desktop: 4 cols
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-xl);
    }
}

/* Mobile: Show only 4 products (2 rows × 2 cols) */
@media (max-width: 639px) {
    .product-grid > *:nth-child(n+5) {
        display: none;
    }
}

/* ============================================
   PRODUCT CARD - MODERN MOBILE-FIRST DESIGN
   ============================================ */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.product-card__image {
    display: block;
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f9fa;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card__image img {
    transform: scale(1.03);
}

/* Badges */
.badge-sale,
.badge-new,
.badge-featured,
.badge-hot {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    color: white;
}

.badge-sale { background: #ef4444; }
.badge-new { background: #3b82f6; }
.badge-featured { background: #f59e0b; }
.badge-hot { background: #f97316; }

.product-card__body {
    padding: 12px;
}

@media (min-width: 640px) {
    .product-card__body {
        padding: 16px;
    }
}

.product-card__title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
    text-decoration: none;
}

@media (min-width: 640px) {
    .product-card__title {
        font-size: 14px;
        min-height: 40px;
    }
}

.product-card__title:hover {
    color: oklch(var(--p));
}

.product-card__price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}

.product-card__price {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

@media (min-width: 640px) {
    .product-card__price {
        font-size: 18px;
    }
}

.product-card__price-old {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
}

.product-card__btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: oklch(var(--p));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.product-card__btn:hover {
    filter: brightness(1.1);
}

.product-card__btn:active {
    transform: scale(0.98);
}

.product-card__btn i {
    font-size: 14px;
}

/* ============================================
   ADMIN CARDS - STAT CARDS
   ============================================ */
.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    border: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.stat-card__icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card__label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: var(--space-xs);
}

.stat-card__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

/* ============================================
   ADMIN TABLE - CLEAN
   ============================================ */
.table-clean {
    width: 100%;
    border-collapse: collapse;
}

.table-clean thead {
    background: #f8f9fa;
}

.table-clean th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.table-clean td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.table-clean tbody tr:hover {
    background: #f9fafb;
}

.table-clean tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   ADMIN PANEL - CARDS
   ============================================ */
.panel-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(0,0,0,0.06);
    overflow: hidden;
}

.panel-card__header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.panel-card__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

.panel-card__body {
    padding: 0;
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    border: 1px solid rgba(0,0,0,0.06);
    margin-bottom: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .filter-bar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.filter-bar__form {
    display: flex;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .filter-bar__form {
        align-items: center;
    }
}

.filter-bar__input {
    flex: 1;
    height: 2.75rem;
    padding: 0 var(--space-md) 0 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-bar__input:focus {
    outline: none;
    border-color: oklch(var(--p));
    box-shadow: 0 0 0 3px oklch(var(--p) / 0.1);
}

.filter-bar__select {
    height: 2.75rem;
    padding: 0 var(--space-lg) 0 var(--space-md);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    background: white;
    cursor: pointer;
    min-width: 140px;
}

/* ============================================
   BUTTONS - SIMPLIFIED
   ============================================ */
.btn-clean {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0 var(--space-lg);
    height: 2.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-clean--primary {
    background: oklch(var(--p));
    color: white;
}

.btn-clean--primary:hover {
    filter: brightness(1.1);
}

.btn-clean--ghost {
    background: transparent;
    color: #6b7280;
}

.btn-clean--ghost:hover {
    background: #f3f4f6;
}

.btn-clean--sm {
    height: 2.25rem;
    padding: 0 var(--space-md);
    font-size: 0.8rem;
}

/* ============================================
   BADGES - CLEAN
   ============================================ */
.badge-clean {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.badge-clean--success {
    background: #dcfce7;
    color: #166534;
}

.badge-clean--warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-clean--error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-clean--neutral {
    background: #f3f4f6;
    color: #4b5563;
}

/* ============================================
   AVATAR
   ============================================ */
.avatar-clean {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
}

.empty-state__icon {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius-full);
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    font-size: 1.5rem;
    color: #9ca3af;
}

.empty-state__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: var(--space-sm);
}

.empty-state__text {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ============================================
   MODAL - CLEAN
   ============================================ */
.modal-clean .modal-box {
    border-radius: var(--radius-xl);
    padding: 0;
    max-width: 40rem;
}

.modal-clean__header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid #f3f4f6;
}

.modal-clean__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.modal-clean__body {
    padding: var(--space-xl);
}

.modal-clean__footer {
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

/* ============================================
   FORM CONTROLS - CLEAN
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    margin-bottom: var(--space-sm);
}

.form-input {
    width: 100%;
    height: 2.75rem;
    padding: 0 var(--space-md);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: oklch(var(--p));
    box-shadow: 0 0 0 3px oklch(var(--p) / 0.1);
}

.form-select {
    width: 100%;
    height: 2.75rem;
    padding: 0 var(--space-lg) 0 var(--space-md);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: white;
}

/* ============================================
   ALERTS - CLEAN
   ============================================ */
.alert-clean {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-clean--success {
    background: #dcfce7;
    color: #166534;
}

.alert-clean--error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-clean i {
    font-size: 1rem;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

@media (min-width: 768px) {
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.page-header__title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
}

.page-header__subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: var(--space-xs);
}

/* ============================================
   SECTION HEADER - HOMEPAGE
   ============================================ */
.section-header {
    margin-bottom: var(--space-xl);
}

.section-header__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: var(--space-xs);
}

@media (min-width: 768px) {
    .section-header__title {
        font-size: 1.5rem;
    }
}

.section-header__line {
    width: 3rem;
    height: 3px;
    background: oklch(var(--p));
    border-radius: var(--radius-full);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-muted {
    color: #6b7280;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ============================================
   ANIMATIONS - SUBTLE
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   HOMEPAGE MOBILE IMPROVEMENTS
   ============================================ */
@media (max-width: 639px) {
    /* Tighter container padding on mobile */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Smaller section padding on mobile */
    section[class*="py-12"] {
        padding-top: 24px !important;
        padding-bottom: 24px !important;
    }
    
    section[class*="py-10"] {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }
    
    /* Improve section headers on mobile */
    .section-title {
        font-size: 1.25rem !important;
        margin-bottom: 12px;
    }
    
    /* Hero section improvements */
    .swiper-slide .text-4xl,
    .swiper-slide .text-5xl {
        font-size: 1.5rem !important;
    }
    
    /* Category cards on mobile */
    .category-card {
        padding: 12px;
    }
    
    /* Trust badges grid */
    .trust-badges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* Section header cleanup */
.section-header {
    margin-bottom: 16px;
}

@media (min-width: 640px) {
    .section-header {
        margin-bottom: 24px;
    }
}
