/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&family=Inter:wght@400;600;700&display=swap');

:root {
    --primary: #DC2626;
    --secondary: #1E3A8A;
    --text: #1F2937;
    --text-light: #6B7280;
    --bg: #F9FAFB;
    --surface: #FFFFFF;
    --border: #E5E7EB;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', 'Tajawal', sans-serif; background: var(--bg); color: var(--text); }

/* NEW HEADER STYLES */
.header-main { background: #fff; width: 100%; border-bottom: 2px solid #F3F4F6; margin-bottom: 20px; }
.header-top { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; gap: 40px; }
.logos { display: flex; align-items: center; gap: 15px; }
.logos .logo { text-decoration: none; }
.search-bar { flex: 1; max-width: 600px; display: flex; justify-content: flex-end;}
.search-bar form { display: flex; width: 100%; border: 1px solid #CBD5E1; border-radius: 30px; overflow: hidden; height: 45px;}
.search-bar input { flex: 1; border: none; padding: 0 20px; font-size: 0.95rem; outline: none; }
.search-bar button { background: #1c2331; border: none; padding: 0 25px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.header-partners { border-top: 1px solid #F3F4F6; border-bottom: 1px solid #F3F4F6; padding: 12px 0; overflow-x: auto; }
.partners-list { display: flex; align-items: center; justify-content:flex-start; gap: 30px; }
.partner-item { display: flex; align-items: center; }
.partner-item:not(:last-child)::after { content: '|'; color: #D1D5DB; margin-left: 30px; }

.header-bottom { padding: 15px 0; overflow-x: auto; }
.nav-categories { display: flex; align-items: center; gap: 25px; white-space: nowrap; }
.nav-categories a { text-decoration: none; color: #6B7280; font-weight: 500; font-size: 0.95rem; display: flex; align-items: center; }
.nav-categories a.active { color: #047857; font-weight: 700; }
.nav-categories a:hover { color: var(--primary); }
.nav-categories .arrow { color: #9CA3AF; font-size: 0.8em; margin-left:10px; font-weight:400; }

@media (max-width: 768px) {
    .header-top { flex-direction: column; gap: 15px; align-items: stretch; }
    .search-bar { max-width: 100%; }
}

/* GRID CATALOG */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
main.container { padding-bottom: 40px; }
.section-title { font-size: 1.4rem; margin-bottom: 20px; font-weight: 800; font-style: italic; color: #4B5563; text-align:left; border-bottom: 1px solid #E5E7EB; padding-bottom:10px;}

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }

.product-card { 
    background: #ffffff; 
    border-radius: 4px; 
    overflow: hidden; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    transition: transform 0.2s, box-shadow 0.2s; 
    display: flex; 
    flex-direction: column; 
    text-decoration: none; 
    position: relative; 
    border: 1px solid #f0f0f0;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); background: #fafafa; }

.card-brand-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #E53935;
    color: white;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 800;
    z-index: 10;
}

.card-img-wrapper {
    height: 180px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.card-title {
    padding: 0 15px 15px 15px;
    font-size: 0.85rem;
    color: #4B5563;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.card-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
}
.card-tab {
    background: #1a1a1a;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 2px 20px;
    border-top-left-radius: 4px; border-top-right-radius: 4px;
    margin-bottom: -1px;
    z-index: 2;
}
.card-price-block {
    background: #1c2331;
    width: 100%;
    text-align: center;
    padding: 8px;
    color: white;
}
.card-price-block .amount {
    font-size: 1.1rem; margin-right: 3px; font-weight: 800;
}
.card-price-block .currency {
    font-size: 0.7rem; color: #cbd5e1; font-weight: normal; text-transform: none;
}
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* HORIZONTAL CARDS */
.product-grid-horizontal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px;}
@media(max-width: 800px) { .product-grid-horizontal { grid-template-columns: 1fr; } }

.product-card-horizontal {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    text-decoration: none;
    position: relative;
    border: 1px solid #f0f0f0;
    padding: 15px;
    align-items: center;
    transition: 0.2s;
}
.product-card-horizontal:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.pch-img { width: 100px; height: 100px; display: flex; align-items:center; justify-content:center; }
.pch-img img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply;}
.pch-info { flex: 1; padding-left: 15px; }
.pch-brand { font-size: 0.7rem; color: #9CA3AF; font-weight: bold; text-transform: uppercase; margin-bottom:2px;}
.pch-title { font-size: 0.85rem; color: #1F2937; font-weight: 700; margin-bottom: 8px; line-height:1.2;}
.pch-badge { background: #E53935; color: white; display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.65rem; font-weight:bold; margin-bottom:8px;}
.pch-price { margin-right: 10px; }
.pch-price span.amt { font-size: 1.1rem; font-weight: 800; color: #1F2937; }
.pch-price span.cur { font-size: 0.75rem; color: #6B7280; }
.pch-btn { background: #1c2331; color: white; padding: 4px 12px; border-radius: 12px; font-size: 0.7rem; font-weight:600; white-space:nowrap;}

/* SEARCH VERTICAL CARDS */
.search-card {
    background: #fff; border-radius: 8px; border: 1px solid #e5e7eb; padding: 15px; display: flex; flex-direction: column; text-decoration: none; color: #1f2937; transition: 0.2s;
}
.search-card:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.05); transform: translateY(-2px);}
.sc-img { height: 160px; display: flex; align-items:center; justify-content:center; margin-bottom: 15px; }
.sc-img img { max-height:100%; max-width:100%; object-fit:contain; mix-blend-mode: multiply;}
.sc-title { font-size: 0.85rem; font-weight: 700; line-height:1.4; margin-bottom: 10px; flex:1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sc-brand { display:inline-block; background: #000; color: white; font-size: 0.65rem; padding: 3px 8px; border-radius: 4px; font-weight: bold; margin-bottom: 10px;}
.sc-badge { background: #E53935; color: white; display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.7rem; font-weight:bold; margin-bottom:5px;}
.sc-price { margin-top: auto; }
.sc-price .amt { font-size: 1.1rem; font-weight:800; color:#1c2331;}
.sc-price .cur { font-size: 0.75rem; color:#6b7280; }

/* PRODUCT PAGE */
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; background: var(--surface); padding: 40px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.05); }
.product-left { position:relative; background:#fff; border-radius:12px; padding:20px; border:1px solid var(--border); display:flex; align-items:center; justify-content:center;}
.product-left img { max-width: 100%; max-height: 500px; object-fit:contain; }
.product-right { display: flex; flex-direction: column; }

.main-price-badge { background: #1a1a1a; color: white; display: inline-flex;  padding: 8px 16px; border-radius: 4px; font-weight: 800; font-size: 1.5rem; transform: skewX(-10deg); margin-bottom:20px; align-self: flex-start;}
.main-price-badge span { transform: skewX(10deg); font-style:italic;}

.product-meta { font-size: 0.9rem; color: var(--text-light); margin-bottom: 20px; }
.specs-list { list-style: none; margin-bottom: 30px; }
.specs-list li { margin-bottom: 10px; font-size: 0.95rem; display: flex; padding-bottom:10px; border-bottom:1px solid #f0f0f0;}
.specs-list li span.label { width: 40%; font-weight: 600; color: var(--text-light); }
.specs-list li span.value { font-weight: 500; }

.action-area { display: flex; align-items: center; gap: 20px; margin-bottom: 40px; }
.btn-buy { background: #EF4444; color: white; font-weight: 700; padding: 12px 30px; border-radius: 30px; text-decoration: none; font-size: 1.1rem; border: none; cursor: pointer; display:inline-flex; align-items:center; gap:10px; box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4); transition:0.2s; }
.btn-buy:hover { background: #DC2626; transform: translateY(-2px);}

/* Installment Plans */
.installment-section { margin-top: 20px; border-top: 2px solid var(--border); padding-top:20px;}
.installment-list { display: flex; flex-direction: column; gap: 10px; }
.installment-plan { background: #1a1a1a; color: white; padding: 12px 20px; border-radius: 30px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; width: 100%; max-width: 400px; cursor: pointer; transition: 0.2s;}
.installment-plan:hover { transform: translateX(5px); background: var(--secondary);}
.installment-plan .price { font-size: 1.2rem; }
.installment-plan .duration { font-size: 0.9rem; font-weight:400; opacity:0.8;}

/* MODAL */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 2000; backdrop-filter: blur(4px); }
.modal-overlay.active { display: flex; }
.modal { background: var(--surface); padding: 30px; border-radius: 12px; width: 90%; max-width: 450px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); position:relative;}
.modal-close { position: absolute; top: 15px; right: 15px; cursor: pointer; font-size: 1.5rem; color: var(--text-light); }
.modal-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; color: var(--secondary); text-align:center;}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.9rem;}
.form-control { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; outline: none; transition: border-color 0.2s;}
.form-control:focus { border-color: var(--primary); }

@media (max-width: 768px) {
    .product-layout { grid-template-columns: 1fr; padding: 20px;}
    .specs-list li { flex-direction: column; }
    .specs-list li span.label { width: 100%; margin-bottom:5px;}
}

/* SMARTPHONE OPTIMIZATION */
/* Header & Nav */
@media (max-width: 600px) {
    .header-top { gap: 10px; padding: 10px 0; }
    .search-bar { width: 100%; flex:none;}
    .nav-categories { justify-content: flex-start; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
    
    /* Category blocks */
    .category-poster { width: 100% !important; min-height: 120px !important; margin-bottom: 10px; }
    
    /* Horizontal product layout changes into stack or smaller elements */
    .product-grid-horizontal { grid-template-columns: 1fr; gap: 10px; }
    .product-card-horizontal { padding: 10px; flex-direction: row; }
    .pch-img { width: 80px; height: 80px; }
    .pch-title { font-size: 0.8rem; }
    .pch-price span.amt { font-size: 1rem;}
    
    /* Standard Cards */
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-img-wrapper { height: 120px; padding: 10px; }
    .card-title { font-size: 0.75rem; padding: 0 10px 10px 10px; }
    .card-price-block .amount { font-size: 0.95rem; }
    
    /* Search Cards */
    .search-card { padding: 10px; }
    .sc-img { height: 100px; }
    .sc-title { font-size: 0.8rem; }
    
    /* Hide specific desktop UI */
    button[onclick*="scrollBy"] { display: none !important; } /* Use touch swiping instead of buttons */
    .hero-slider-section img { max-height: 250px; }
    
    .action-area { flex-direction: column; align-items: stretch; }
    .btn-buy { text-align: center; justify-content: center; }
    .installment-plan { max-width: 100%; }
}
