/* public/assets/css/home.css */

/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --primary: #ee4d2d;
    --bg: #f8f9fa;
    --text: #212529;
    --surface: #ffffff;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding-bottom: 90px;
}

/* =========================================
   2. HEADER & SEARCH
   ========================================= */
.app-header {
    background: linear-gradient(180deg, #ee4d2d 0%, #ff6b4a 100%);
    padding: 15px 15px 50px 15px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.search-bar {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.search-bar input {
    border: none;
    flex: 1;
    margin-left: 10px;
    font-size: 0.95rem;
}

/* =========================================
   3. PRODUCT GRID
   ========================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 10px;
    margin-top: -30px;
}

.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
    display: flex;
    flex-direction: column;
}

.card-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: #eee;
}

.card-body {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    margin-top: auto;
}

.btn-add {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(238, 77, 45, 0.4);
}

/* =========================================
   4. FLOATING ACTION BUTTON (CART)
   ========================================= */
.fab {
    position: fixed;
    bottom: 85px;
    right: 20px;
    background: var(--text);
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 90;
    cursor: pointer;
    transition: 0.2s;
}

.fab:active {
    transform: scale(0.9);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    font-weight: bold;
}

/* =========================================
   5. BOTTOM NAVIGATION
   ========================================= */
.nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    text-decoration: none;
    font-size: 0.7rem;
    gap: 3px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item i {
    font-size: 1.4rem;
}

/* =========================================
   6. MODAL SYSTEM (CART & CHECKOUT)
   ========================================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    align-items: flex-end;
    backdrop-filter: blur(3px);
}

.modal-box {
    background: #f8f9fa;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

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

.modal-header {
    background: white;
    padding: 15px;
    text-align: center;
    font-weight: 700;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-body {
    padding: 15px;
}

/* =========================================
   7. CHECKOUT UI COMPONENTS
   ========================================= */
/* Address Section */
.address-section {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    position: relative;
}

.addr-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.addr-main {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.addr-sub {
    font-size: 0.85rem;
    color: #666;
    margin-top: 3px;
    line-height: 1.4;
}

.addr-change {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
}

/* Item List */
.checkout-item {
    display: flex;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.checkout-img {
    width: 50px;
    height: 50px;
    background: #eee;
    border-radius: 4px;
    object-fit: cover;
}

/* Summary & Total */
.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #555;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
    color: var(--primary);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    border-radius: 8px;
}

.btn-secondary {
    width: 100%;
    padding: 15px;
    background: #e9ecef;
    color: #333;
    border: none;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
}

/* =========================================
   8. PAYMENT METHOD STYLES (NEW)
   ========================================= */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-option input {
    display: none; /* Hide default radio button */
}

.payment-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    background: white;
}

/* Highlight Selected Payment */
.payment-option input:checked + .payment-card {
    border-color: var(--primary);
    background-color: #fff5f2; /* Soft Orange */
    box-shadow: 0 0 0 1px var(--primary);
}

/* =========================================
   9. ADDRESS SELECTOR MODAL
   ========================================= */
.addr-option {
    padding: 15px;
    background: white;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.addr-option.selected {
    background: #fff5f2;
    border-left: 4px solid var(--primary);
}