/*
Theme Name: CODZ
Theme URI: https://example.com/codz
Author: Antigravity
Description: A modern, simple, and fast WooCommerce theme tailored for Cash on Delivery (COD) in Algeria.
Version: 1.0.0
Text Domain: codz
Tags: e-commerce, custom-colors, responsive-layout
*/

:root {
    --primary-color: #ff6b6b; /* Vibrant coral red for high conversion */
    --secondary-color: #4ecdc4; /* Soft teal for trust */
    --text-color: #2b2b2b;
    --text-muted: #6c757d;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --border-color: #e9ecef;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Tajawal', 'Almarai', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Modern Arabic fonts */
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl; /* RTL by default for Arabic */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #e05252;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

/* Header */
.site-header {
    background-color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

.site-title a {
    color: var(--text-color);
}

.site-title a span {
    color: var(--primary-color);
}

/* Footer */
.site-footer {
    background-color: var(--white);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Grid layout for products */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    margin-bottom: 1rem;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: center;
}

.btn:hover {
    background-color: #e05252;
    color: var(--white);
    transform: scale(1.02);
}

/* Single Product Page - Hanout Style */
.single-product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
    background: var(--white);
}

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

/* Hanout Gallery */
.hanout-gallery {
    position: relative;
}

.hanout-sale-badge {
    position: absolute;
    top: 10px;
    right: 10px; /* RTL right */
    background-color: #2196f3;
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.1rem;
    z-index: 10;
}

.main-image-wrapper {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.main-image-wrapper img {
    width: 100%;
    display: block;
}

.product-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.gallery-thumb.active {
    border-color: #2196f3;
}

/* Hanout Details */
.hanout-details {
    padding: 1rem 0;
    text-align: center;
}

.hanout-badge-wrapper {
    margin-bottom: 10px;
}

.hanout-badge-new {
    background-color: #ffd54f;
    color: #000;
    padding: 3px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

.hanout-title {
    font-size: 2rem;
    font-weight: 900;
    color: #111;
    margin-bottom: 10px;
    line-height: 1.3;
}

.hanout-stars {
    color: #ffc107;
    font-size: 1.5rem;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.hanout-price-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.hanout-current-price {
    color: #2196f3;
    font-size: 2.2rem;
    font-weight: 900;
}

.hanout-old-price {
    color: #9e9e9e;
    font-size: 1.5rem;
    text-decoration: line-through;
}

.hanout-discount-badge {
    background-color: #f44336;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
}

.hanout-subtitle {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 25px;
}

/* Hanout Form Wrapper */
.hanout-cod-form-wrapper {
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 20px;
    background: var(--white);
    margin-top: 10px;
    position: relative;
}

.hanout-form-title {
    text-align: center;
    font-weight: bold;
    color: #111;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

/* Specific COD Form overrides for Hanout style */
.hanout-cod-form-wrapper .cod-dz-order-form .cod-dz-form-section {
    margin-bottom: 0 !important;
}

.hanout-cod-form-wrapper .cod-dz-order-form .cod-dz-section-title {
    display: none !important;
}

.hanout-cod-form-wrapper .cod-dz-order-form .cod-dz-label {
    display: none !important;
}

.hanout-cod-form-wrapper .personal-info-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.hanout-cod-form-wrapper .personal-info-row > div {
    flex: 1;
}

@media (max-width: 600px) {
    .hanout-cod-form-wrapper .personal-info-row {
        flex-direction: column;
    }
}

.hanout-cod-form-wrapper .cod-dz-input,
.hanout-cod-form-wrapper .cod-dz-select {
    border: 1px solid #90caf9 !important;
    border-radius: 4px !important;
    height: 48px !important;
    padding: 10px 15px 10px 40px !important; /* Space for icon on left */
    background-color: #fff !important;
}

.hanout-input-wrapper {
    position: relative;
    width: 100%;
}

.hanout-input-icon {
    position: absolute;
    left: 15px; /* Icon on the left side of the input */
    top: 50%;
    transform: translateY(-50%);
    color: #757575;
    font-size: 1.2rem;
    pointer-events: none;
}

/* --- New Exact Form Redesign Styles --- */
.hanout-form-rows {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hanout-row {
    display: flex;
    gap: 15px;
    width: 100%;
}

.hanout-row > div {
    flex: 1;
}

.hanout-input {
    width: 100%;
    border: 1px solid #bbdefb !important;
    border-radius: 4px !important;
    height: 48px !important;
    padding: 10px 15px !important;
    background-color: #fff !important;
    text-align: right !important;
    font-size: 1rem;
    color: #333;
    transition: border-color 0.3s;
}

.hanout-input:focus {
    border-color: #2196f3 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.hanout-input::placeholder {
    color: #888;
    opacity: 1;
}

/* Submit and Quantity Row */
.hanout-action-row {
    display: flex;
    gap: 15px;
}

.hanout-submit-btn {
    flex: 2 !important; /* takes 70% roughly */
    background-color: #2196f3 !important;
    background-image: linear-gradient(45deg, rgba(255,255,255,0.05) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.05) 75%, transparent 75%, transparent) !important;
    background-size: 20px 20px !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    height: 50px !important;
    font-size: 1.2rem !important;
    font-weight: bold !important;
    cursor: pointer;
    transition: opacity 0.3s;
}

.hanout-submit-btn:hover {
    opacity: 0.9;
}

.hanout-submit-btn:disabled {
    background-color: #90caf9 !important;
    cursor: not-allowed;
}

.hanout-quantity-selector {
    flex: 1 !important; /* takes 30% roughly */
    display: flex;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    height: 50px;
    background: #fff;
    overflow: hidden;
}

.hanout-qty-btn {
    background: #fff;
    border: none;
    color: #333;
    font-size: 1.5rem;
    padding: 0 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.hanout-qty-btn:hover {
    background: #f1f1f1;
}

.hanout-qty-input {
    width: 100%;
    border: none !important;
    border-left: 1px solid #bbdefb !important;
    border-right: 1px solid #bbdefb !important;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    -moz-appearance: textfield;
}

.hanout-qty-input::-webkit-outer-spin-button,
.hanout-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* WhatsApp Button */
.hanout-whatsapp-btn {
    width: 100%;
    background-color: #25d366 !important;
    color: white !important;
    border: none !important;
    border-radius: 50px !important;
    height: 50px !important;
    font-size: 1.1rem !important;
    font-weight: bold !important;
    cursor: pointer;
    transition: transform 0.2s;
}

.hanout-whatsapp-btn:hover {
    transform: scale(1.02);
}

/* Order Summary Accordion */
.hanout-summary-container {
    margin-top: 10px;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    background: #f9fbfc;
    overflow: hidden;
}

.hanout-summary-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #f0f7ff;
    color: #555;
    font-weight: bold;
    border-bottom: 1px solid transparent;
    transition: background 0.2s;
}

.hanout-summary-header:hover {
    background: #e3f2fd;
}

.hanout-summary-header.open {
    border-bottom-color: #bbdefb;
}

.hanout-summary-arrow {
    transition: transform 0.3s;
}

.hanout-summary-arrow::before {
    content: "▼";
    font-size: 0.8rem;
    color: #90caf9;
}

.hanout-summary-header.open .hanout-summary-arrow {
    transform: rotate(180deg);
}

.hanout-summary-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 15px;
}

.hanout-summary-body.open {
    max-height: 300px;
    padding: 15px;
}

.hanout-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #bbdefb;
}

.hanout-summary-row:last-child {
    border-bottom: none;
}

.hanout-summary-label {
    color: #555;
}

.hanout-product-name {
    font-weight: bold;
    color: #333;
}

.hanout-summary-value {
    color: #555;
}

.hanout-qty-badge {
    background: #2196f3;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 5px;
}

.hanout-total-row {
    font-weight: bold;
    font-size: 1.2rem;
}

.hanout-total-row .hanout-summary-value {
    color: #2196f3;
}

@media (max-width: 600px) {
    .hanout-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .hanout-action-row {
        flex-direction: column;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .single-product-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1rem;
    }
    
    .product-details h1 {
        font-size: 1.8rem;
    }
    
    .product-details .price {
        font-size: 1.6rem;
    }
}
