/* ==========================================
   KZone STORE - Main Stylesheet
   ========================================== */

/* --- أساسيات --- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    max-width: 100vw;
    overflow-x: hidden;
    background-color: #f4f6f9;
    color: #333;
    padding-top: 75px;
}

a { text-decoration: none; }

/* ==========================================
   HEADER & NAVBAR
   ========================================== */
.top-navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 60px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    z-index: 2000;
    direction: rtl;
}
.navbar-right-side { display: flex; align-items: center; gap: 12px; }
.brand-name { font-weight: bold; font-size: 18px; color: #1a1a2e; }
.navbar-left-side { display: flex; align-items: center; }

.menu-trigger-btn {
    padding: 10px 16px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}
.menu-trigger-btn:hover { background: #333; }

.cart-btn-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    background: #f1f3f5;
    border-radius: 50%;
    text-decoration: none;
}
.cart-btn-nav:hover { background: #e2e6ea; }
.cart-icon { font-size: 22px; }
.cart-badge-count {
    position: absolute;
    top: -3px; right: -3px;
    background: #e94560;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 6px;
    min-width: 14px;
    text-align: center;
}

/* Sidebar */
.custom-sidebar {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 9999;
    top: 0; right: 0;
    background: #111;
    overflow-x: hidden;
    transition: 0.3s;
    padding-top: 60px;
    text-align: right;
    direction: rtl;
    box-shadow: -2px 0 15px rgba(0,0,0,0.5);
}
.custom-sidebar a {
    padding: 14px 22px;
    display: block;
    font-size: 16px;
    color: #b8b8b8;
    transition: 0.2s;
}
.custom-sidebar a:hover { color: #fff; background: #1a1a1a; padding-right: 28px; }
.custom-sidebar .closebtn {
    position: absolute;
    top: 10px; left: 25px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
}
.user-welcome-box {
    padding: 15px 20px;
    color: #fff;
    background: #1a1a1a;
    margin: 10px 15px;
    border-radius: 8px;
    border-right: 4px solid #e94560;
}

/* Logo */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}
.logo-image {
    width: 120px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ==========================================
   SEARCH
   ========================================== */
.search-container {
    position: relative;
    width: 90%;
    max-width: 450px;
    margin: 10px auto;
}
#searchInput {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 30px;
    outline: none;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
#searchInput:focus { border-color: #e94560; }
#suggestionsBox {
    position: absolute;
    top: 100%;
    width: 100%;
    background: #fff;
    border-radius: 14px;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    display: none;
    overflow: hidden;
}
#suggestionsBox a {
    display: block;
    padding: 14px 18px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
#suggestionsBox a:hover { background: #fff5f5; color: #e94560; }

/* ==========================================
   MARQUEE
   ========================================== */
.marquee-wrapper {
    width: 100%;
    background: #333;
    color: #fff;
    padding: 10px 0;
    text-align: center;
    overflow: hidden;
    height: 40px;
    position: relative;
}
.marquee-text {
    position: absolute;
    width: 100%;
    opacity: 0;
    animation: fade 15s infinite;
    font-weight: bold;
    font-size: 13px;
}
@keyframes fade {
    0% { opacity: 0; }
    5% { opacity: 1; }
    18% { opacity: 1; }
    20% { opacity: 0; }
    100% { opacity: 0; }
}
.msg-1 { animation-delay: 0s; }
.msg-2 { animation-delay: 3s; }
.msg-3 { animation-delay: 6s; }
.msg-4 { animation-delay: 9s; }
.msg-5 { animation-delay: 12s; }

/* ==========================================
   BUTTONS
   ========================================== */
.btn-back-home {
    display: inline-block !important;
    text-align: center !important;
    padding: 12px 30px;
    background: #1a1a2e;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s;
    cursor: pointer;
    width: auto;
}
.btn-back-home:hover {
    background: #16213e;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}
.back-home-wrapper {
    width: 100%;
    text-align: center;
    margin: 30px 0 15px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}
.login-btn:hover { background: #c0392b; }

/* ==========================================
   LOGIN PAGE
   ========================================== */
.login-page-wrapper {
    background: #f4f7f6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.login-card {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.login-input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}

/* ==========================================
   CARDS & GRIDS
   ========================================== */
.category-container,
.product-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 15px;
    max-width: 1000px;
    margin: 0 auto;
}
@media (min-width: 600px) {
    .category-container,
    .product-container { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .category-container,
    .product-container { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}

.category-card,
.product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
}
.category-card:hover,
.product-card:hover {
    transform: translateY(-6px);
    border-color: #e94560;
    box-shadow: 0 12px 25px rgba(233,68,96,0.12);
}

/* ==========================================
   CART PAGE
   ========================================== */
.cart-page-container {
    width: 100%;
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}
.cart-items-section { flex: 2; min-width: 280px; }
.cart-summary-section { flex: 1; min-width: 240px; }

.cart-item-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-right: 5px solid #e94560;
    gap: 12px;
}
.cart-item-card:hover { transform: translateY(-2px); }
.delete-item-btn {
    background: #fff5f5;
    color: #dc3545;
    border: 1px solid #ffe3e3;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
}
.delete-item-btn:hover { background: #dc3545; color: #fff; }

.summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 85px;
    border: 1px solid #e5e7eb;
}
.summary-card h3 { color: #1a1a2e; }
.total-row {
    border-top: 1px dashed #ddd;
    padding-top: 14px;
    margin-top: 14px;
    font-size: 20px;
    font-weight: bold;
    color: #28a745;
}
.checkout-btn {
    width: 100%;
    padding: 14px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 14px;
}
.checkout-btn:hover { background: #c0392b; }
.empty-cart {
    width: 100%;
    text-align: center;
    background: #fff;
    padding: 60px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* ==========================================
   PAYMENT & CATEGORY BOXES
   ========================================== */
.payment-box,
.category-box {
    border: 2px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    background: #fff;
    transition: 0.3s;
}
.payment-box:hover,
.category-box:hover {
    border-color: #e94560;
    background: #fff5f5;
}
input[type="radio"]:checked + .payment-box,
input[type="radio"]:checked ~ .payment-box {
    border-color: #28a745;
    background: #e8f5e9;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ==========================================
   MODAL
   ========================================== */
.checkout-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: #fff;
    padding: 25px 20px;
    border-radius: 20px;
    width: 92%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    text-align: right;
    position: relative;
}
.close-modal {
    position: absolute;
    top: 12px; left: 15px;
    font-size: 26px;
    cursor: pointer;
    color: #888;
}
.close-modal:hover { color: #333; }

/* ==========================================
   ALERTS
   ========================================== */
.alert-box {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 13px;
    text-align: center;
    border: 1px solid #ffeeba;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 480px) {
    body { padding-top: 65px; font-size: 14px; }
    .brand-name { font-size: 16px; }
    .menu-trigger-btn { font-size: 14px; padding: 8px 14px; }
    .cart-btn-nav { width: 40px; height: 40px; }
    .cart-icon { font-size: 20px; }
    .custom-sidebar a { font-size: 16px; padding: 12px 18px; }
    #searchInput { font-size: 14px; padding: 12px 16px; }
    
    .cart-item-card { flex-direction: column; align-items: flex-start; }
    .delete-item-btn { align-self: flex-end; }
    .summary-card { position: static; top: auto; }
}