* {
    box-sizing: border-box;
}

:root {
    --primary-color: #c4662a;
    --primary-color-light: #e4954b;
    --primary-bg: #faf7f4;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: var(--primary-bg);
    color: #333;
}

a {
    text-decoration: none;
}

/* الهيدر */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-light));
    color: #fff;
    padding: 12px 16px 18px;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo {
    width: 75px;
    height: 75px;
    border-radius: 70%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 13px;
    overflow: hidden;
}


.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 2px;
}

.site-subtitle {
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.9;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--primary-color);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.16);
}

.cart-count-badge {
    background: var(--primary-color);
    color: #fff;
    border-radius: 999px;
    padding: 0 6px;
    font-size: 11px;
}

.search-wrapper {
    margin-top: 14px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 999px;
    border: none;
    font-size: 13px;
    outline: none;
}

/* محتوى الصفحة */
.page {
    padding: 14px 12px 80px;
    max-width: 900px;
    margin: 0 auto;
}

.categories-title {
    font-size: 15px;
    margin: 0 0 10px;
    font-weight: 600;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

@media (min-width: 700px) {
    .categories-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.category-card {
    background: #fff;
    border-radius: 12px;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 13px;
    transition: 0.15s;
}

.category-card.active {
    background: var(--primary-color-light);
    color: #fff;
}

.category-card:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.category-icon {
    font-size: 18px;
}

.products-title {
    font-size: 15px;
    margin: 6px 0 10px;
    font-weight: 600;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.product-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    background: #eee;
}

.product-body {
    padding: 10px 12px 12px;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.product-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

.product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
}

.add-to-cart {
    border: none;
    background: var(--primary-color-light);
    color: #fff;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
}

.add-to-cart:active {
    opacity: 0.85;
}

.variant-select {
    width: 100%;
    margin-top: 4px;
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 12px;
}

/* التعدد (الصفحات) */
.pagination {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.page-btn {
    border: 1px solid var(--primary-color-light);
    background: #fff;
    color: var(--primary-color);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

.page-btn.active {
    background: var(--primary-color-light);
    color: #fff;
}

/* السلة */
.cart-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    z-index: 90;
}

.cart-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 10px 12px 16px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
    transform: translateY(100%);
    transition: transform 0.2s ease-out;
    z-index: 91;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-panel.open {
    transform: translateY(0);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header-title {
    font-size: 15px;
    font-weight: 600;
}

.cart-close {
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
}

.cart-items {
    max-height: 180px;
    overflow-y: auto;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding-top: 4px;
}

.cart-row {
    display: grid;
    grid-template-columns: 2.2fr 0.9fr 0.9fr auto;
    gap: 4px;
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f1f1;
    align-items: center;
}

.cart-row:last-child {
    border-bottom: none;
}

.cart-qty-input {
    width: 48px;
}

.cart-remove {
    border: none;
    background: #e25d4f;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 12px;
}

.cart-summary {
    font-size: 13px;
}

.cart-summary strong {
    font-size: 14px;
}

.customer-fields {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    margin-top: 2px;
}

.customer-fields input,
.customer-fields textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 6px 8px;
    font-size: 12px;
}

.customer-fields textarea {
    resize: vertical;
}

.btn-whatsapp {
    margin-top: 6px;
    width: 100%;
    border: none;
    border-radius: 999px;
    background: #25D366;
    color: #fff;
    padding: 9px;
    font-size: 14px;
    cursor: pointer;
}

/* زر واتساب عائم */
.wa-floating {
    position: fixed;
    right: 12px;
    bottom: 18px;
    z-index: 80;
}

.wa-floating a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

@media (min-width: 800px) {
    .cart-panel {
        max-width: 420px;
        margin: 0 auto;
    }
}
.site-footer {
    text-align: center;
    font-size: 12px;
    color: #777;
    padding: 12px 8px 16px;
    border-top: 1px solid #e5e7eb;
    margin-top: 10px;
}
