/* Mobile-First CSS - snacks.vaayunim.com */

/* ===== VARIABLES ===== */
:root {
    --primary: #c0392b;
    --primary-dark: #a83226;
    --secondary: #d4ac0d;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 2rem; font-weight: 600; }
h2 { font-size: 1.75rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.1rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

/* ===== PRODUCT CARDS ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

.product-info {
    padding: 12px;
    flex: 1;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 36px;
}

.product-unit {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 8px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.old-price {
    font-size: 14px;
    color: var(--gray);
    text-decoration: line-through;
}

.discount-badge {
    background: var(--success);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.add-to-cart-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    touch-action: manipulation;
    cursor: pointer;
    transition: var(--transition);
}

.add-to-cart-btn:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}

/* ===== CART PAGE ===== */
.cart-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--box-shadow);
    display: flex;
    gap: 12px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
}

.cart-item-price {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--light);
    border-radius: 8px;
    padding: 4px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: white;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    touch-action: manipulation;
}

.quantity-btn:active {
    background: var(--light);
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: none;
    font-weight: 600;
    background: transparent;
}

.remove-item {
    color: var(--danger);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

/* ===== CART SUMMARY ===== */
.cart-summary {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--box-shadow);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.summary-row.total {
    border-bottom: none;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

/* ===== COUPON SECTION ===== */
.coupon-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--box-shadow);
}

.coupon-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.coupon-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.apply-coupon-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    font-weight: 500;
    cursor: pointer;
}

.available-coupons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.coupon-tag {
    background: var(--light);
    border: 1px dashed var(--primary);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--primary);
}

/* ===== CHECKOUT PAGE ===== */
.checkout-steps {
    display: flex;
    justify-content: space-between;
    margin: 16px 0;
    padding: 0;
    list-style: none;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step::after {
    content: '';
    position: absolute;
    top: 25px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.step:last-child::after {
    display: none;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.step-label {
    font-size: 12px;
    color: var(--gray);
}

/* ===== ADDRESS CARD ===== */
.address-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.address-card.selected {
    border-color: var(--primary);
    background: rgba(192, 57, 43, 0.05);
}

.address-type {
    display: inline-block;
    padding: 4px 12px;
    background: var(--light);
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 8px;
}

.address-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.address-details {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* ===== PAYMENT METHODS ===== */
.payment-method {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}

.payment-method.selected {
    border-color: var(--primary);
    background: rgba(192, 57, 43, 0.05);
}

.payment-method-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-icon {
    width: 40px;
    height: 40px;
    background: var(--light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.payment-info h4 {
    margin: 0;
    font-size: 16px;
}

.payment-info p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--gray);
}

/* ===== ORDER CONFIRMATION ===== */
.confirmation-icon {
    text-align: center;
    margin: 24px 0;
}

.confirmation-icon i {
    font-size: 80px;
    color: var(--success);
}

.order-details-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--box-shadow);
}

.order-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.order-item:last-child {
    border-bottom: none;
}

/* ===== LOADING STATES ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== UTILITIES ===== */
.text-primary { color: var(--primary) !important; }
.bg-primary { background: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }

/* Safe area insets for modern mobile devices */
@supports (padding: max(0px)) {
    .mobile-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    .main-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
}

/* ===== RESPONSIVE TABLETS ===== */
@media (min-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .product-title {
        font-size: 16px;
        height: 42px;
    }
    
    .current-price {
        font-size: 20px;
    }
}