/* ============================================
   Marshop - Custom Styles
   ============================================ */

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #7C3AED;
    --accent: #F59E0B;
    --dark: #111827;
    --dark-card: #1F2937;
    --light-bg: #F9FAFB;
    --success: #22C55E;
    --danger: #EF4444;
    --warning: #F59E0B;
    --text-dark: #1F2937;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background: var(--light-bg);
    -webkit-font-smoothing: antialiased;
    padding-bottom: 70px;
}

@media (min-width: 768px) {
    body { padding-bottom: 0; }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }
.animate-slideLeft { animation: slideInLeft 0.3s ease forwards; }
.animate-slideRight { animation: slideInRight 0.3s ease forwards; }
.animate-slideUp { animation: slideInUp 0.3s ease forwards; }
.animate-pulse { animation: pulse 2s ease infinite; }
.animate-bounce { animation: bounce 1s ease infinite; }

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ============================================
   Header Styles
   ============================================ */
.site-header {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: white;
    z-index: 201;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.sidebar-menu.active {
    transform: translateX(0);
}

/* ============================================
   Bottom Navigation (Mobile)
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
    .bottom-nav { display: none; }
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    padding: 4px 12px;
    transition: var(--transition);
}

.bottom-nav a.active,
.bottom-nav a:hover {
    color: var(--primary);
}

.bottom-nav a svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   Product Card
   ============================================ */
.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card .product-img {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.product-card .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img img {
    transform: scale(1.08);
}

.product-card .product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 2;
}

.product-card .wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: var(--transition);
    z-index: 2;
}

.product-card .wishlist-btn:hover {
    background: var(--danger);
    color: white;
}

.product-card .product-info {
    padding: 12px;
}

.product-card .product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.product-card .product-price {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-card .price-now {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.product-card .price-was {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-card .add-cart-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.product-card .add-cart-btn:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   Flash Sale Timer
   ============================================ */
.flash-sale-section {
    background: linear-gradient(135deg, #FF6B35, #FF3366);
    border-radius: var(--radius);
    padding: 24px;
    color: white;
    margin: 20px 0;
}

.countdown-timer {
    display: flex;
    gap: 8px;
}

.countdown-item {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 8px 12px;
    text-align: center;
    min-width: 60px;
}

.countdown-item .number {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.countdown-item .label {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
    text-transform: uppercase;
}

/* ============================================
   WhatsApp Button
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 99;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37,211,102,0.4);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37,211,102,0.5);
}

@media (min-width: 768px) {
    .whatsapp-float { bottom: 30px; right: 30px; }
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: white;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 400px;
    animation: slideInRight 0.3s ease, fadeIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--primary); }

/* ============================================
   Category Grid
   ============================================ */
.category-item {
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
}

.category-item:hover {
    transform: translateY(-3px);
}

.category-item .cat-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition);
}

.category-item:hover .cat-icon {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(79,70,229,0.2);
}

.category-item .cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.category-item .cat-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

/* ============================================
   Slider / Swiper
   ============================================ */
.hero-slider {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.hero-slider .slide {
    display: none;
    position: relative;
}

.hero-slider .slide.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.hero-slider .slide img {
    width: 100%;
    aspect-ratio: 16/7;
    object-fit: cover;
}

@media (max-width: 768px) {
    .hero-slider .slide img {
        aspect-ratio: 16/9;
    }
}

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.slider-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: var(--transition);
}

.slider-dots .dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* ============================================
   Section Titles
   ============================================ */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
}

.section-title a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.section-title a:hover {
    text-decoration: underline;
}

/* ============================================
   Service Features
   ============================================ */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .service-grid { grid-template-columns: repeat(4, 1fr); }
}

.service-item {
    background: white;
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.service-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.service-item .service-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: var(--primary);
}

.service-item h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.service-item p {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Reviews Section
   ============================================ */
.review-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.review-stars {
    color: var(--accent);
    display: flex;
    gap: 2px;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--dark);
    color: #D1D5DB;
    padding: 40px 0 20px;
}

.site-footer h4 {
    color: white;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
}

.site-footer a {
    color: #9CA3AF;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #6B7280;
}

/* ============================================
   Flash Message
   ============================================ */
.flash-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

.flash-message.success {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.flash-message.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.flash-message.warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

/* ============================================
   Forms
   ============================================ */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    transition: var(--transition);
    background: white;
    color: var(--text-dark);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary-solid {
    background: var(--primary);
    color: white;
}

.btn-primary-solid:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   Utility
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.text-primary { color: var(--primary); }
.bg-primary { background: var(--primary); }

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ============================================
   Image Gallery (Product Page)
   ============================================ */
.product-gallery {
    position: relative;
}

.product-gallery .main-image {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    background: #f3f4f6;
}

.product-gallery .main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-gallery .thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    overflow-x: auto;
}

.product-gallery .thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.product-gallery .thumb.active,
.product-gallery .thumb:hover {
    border-color: var(--primary);
}

.product-gallery .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   Checkout
   ============================================ */
.checkout-section {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.checkout-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Order status */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending { background: #FEF3C7; color: #92400E; }
.status-processing { background: #DBEAFE; color: #1E40AF; }
.status-shipped { background: #E0E7FF; color: #3730A3; }
.status-delivered { background: #DCFCE7; color: #166534; }
.status-cancelled { background: #FEE2E2; color: #991B1B; }
.status-refunded { background: #F3E8FF; color: #6B21A8; }
