/*
Theme Name: Algeria Storefront Pro
Theme URI: https://example.com/dz-storefront-pro
Author: Custom E-Commerce Dev
Description: Clean, high-performance Algerian WooCommerce theme featuring direct COD checkout, unified card layouts, and Facebook Messenger integration.
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: dz-storefront-pro
*/

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
    --primary-color: #27ae60;
    --primary-hover: #219150;
    --messenger-color: #0084FF;
    --messenger-hover: #0073e6;
    --secondary-color: #1e293b;
    --accent-color: #e11d48;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif;
    color: var(--text-color);
    background-color: #fcfcfc;
    line-height: 1.6;
}

.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ================= Header & Search ================= */
.main-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
}

.site-logo a {
    font-size: 22px;
    font-weight: 800;
    color: var(--secondary-color);
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-button {
    position: relative;
    padding: 8px 14px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid var(--border-color);
}

.cart-count {
    background: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 12px;
    margin-right: 4px;
}

.header-search-bar {
    padding: 10px 0 16px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
}

.search-form-wrapper {
    display: flex;
    width: 100%;
}

.search-form-wrapper input[type="search"] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    outline: none;
}

.search-form-wrapper input[type="search"]:focus {
    border-color: var(--primary-color);
}

.search-form-wrapper button {
    padding: 0 24px;
    background: var(--primary-color);
    border: none;
    color: white;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

/* ================= Category Grid ================= */
.categories-section {
    padding: 30px 0 15px;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.category-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.category-image-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: calc(var(--radius-md) - 4px);
    background: #f1f5f9;
}

.category-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-title-pill {
    margin-top: 10px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary-color);
    width: 100%;
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
}

/* ================= Unified Product Grid Card ================= */
.products-section, .archive-products-section {
    padding: 20px 0 40px;
}

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

.product-item-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.2s ease;
}

.product-item-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.product-card-thumb-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    background: #f8fafc;
}

.product-card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.4;
}

.product-card-title a {
    color: var(--secondary-color);
    text-decoration: none;
}

.product-card-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.btn-card-order {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    background: var(--primary-color);
    color: #ffffff;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-card-order:hover {
    background: var(--primary-hover);
}

/* ================= Single Product & Variations ================= */
.single-product-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 32px;
    padding: 30px 0;
}

@media (max-width: 768px) {
    .single-product-layout {
        grid-template-columns: 1fr;
    }
}

.color-swatches-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0 20px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    user-select: none;
    background: #fff;
}

.color-option.active {
    border-color: var(--primary-color);
    background: #f0fdf4;
}

.color-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.color-name {
    font-size: 14px;
    font-weight: 600;
}

.color-option.out-of-stock {
    opacity: 0.55;
    cursor: not-allowed;
    background: #fff5f5;
    border-color: #fed7d7;
}

.color-option.out-of-stock::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--accent-color);
    transform: translateY(-50%);
    pointer-events: none;
}

/* ================= COD Checkout Form & CTAs ================= */
.dz-cod-form-box {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    margin-top: 20px;
}

.dz-cod-form-box h3 {
    margin-bottom: 16px;
    font-size: 18px;
    color: var(--secondary-color);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
}

.shipping-radios {
    display: flex;
    gap: 16px;
    margin-top: 6px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.order-summary-box {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin: 18px 0;
    border: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 6px;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
}

/* Button Group Stack */
.btn-cta-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-order-now {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: background 0.2s;
}

.btn-order-now:hover {
    background: var(--primary-hover);
}

.btn-messenger-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--messenger-color);
    color: #fff;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    transition: background 0.2s;
}

.btn-messenger-chat:hover {
    background: var(--messenger-hover);
}

.btn-messenger-chat svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

.btn-add-to-cart {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}

/* ================= Footer ================= */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 45px 0 25px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.footer-col h4 {
    color: #f8fafc;
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
}

.trust-badges {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    font-size: 13px;
}

.copyright {
    text-align: center;
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    margin-top: 35px;
    font-size: 13px;
}

