/* ====================================================
   Custom Styles for Arabic RTL E-commerce Template
   ====================================================
   
   IMPORTANT NOTES:
   - This file loads AFTER core-style.css
   - It overrides the default LTR styles with RTL support
   - Arabic fonts are imported here
   ==================================================== */

/* ========================================
   1. Arabic Fonts Import
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');

/* ========================================
   2. RTL Base Styles (Override core-style.css)
   ======================================== */

/* Global RTL Direction - Applied to html/body only */
html[dir="rtl"],
html[lang="ar"] {
    direction: rtl;
}

body {
    font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    direction: rtl;
    text-align: right;
}

/* ========================================
   3. Typography Overrides
   ======================================== */

/* Headings - Override core-style.css */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-align: right;
}

/* Body text elements */
p,
span,
a,
li,
label,
button {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    line-height: 1.8;
}

/* Form elements */
input,
textarea,
select {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    direction: rtl;
    text-align: right;
}

/* ========================================
   4. Layout RTL Adjustments
   ======================================== */

/* Lists RTL */
ul,
ol {
    padding-right: 20px;
    padding-left: 0;
}

/* Tables RTL */
table,
table th,
table td {
    text-align: right;
}

/* ========================================
   5. LTR Exception Classes
   ======================================== */

/* For English text or LTR content */
.en,
[lang="en"],
.ltr {
    direction: ltr;
    text-align: left;
}

/* ========================================
   CUSTOM COMPONENT STYLES
   ======================================== */

/* Search Suggestions Styles */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: auto;
    right: 0;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-content {
    position: relative;
}

.suggestions-list {
    padding: 10px 0;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    flex-direction: row-reverse;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
    transform: translateX(-5px);
}

.suggestion-img {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    margin-left: 15px;
    margin-right: 0;
    overflow: hidden;
    border-radius: 5px;
}

.suggestion-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-details h6 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.suggestion-details .price {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fbb710;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* New Product Badge */
.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.new-badge span {
    background: #ff4444;
    color: #fff;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(255, 68, 68, 0.3);
}

/* ========================================
   6. Product Grid Layout
   ======================================== */

.products-catagories-area {
    background: #f5f5f5;
    padding: 15px;
}

.products-catagories-area.clearfix {
    background: #f5f5f5;
}

/* Base Grid - Bigger Products */
.amado-pro-catagory {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Extra Large Desktop (1600px+) - 4 columns */
@media (min-width: 1600px) {
    .amado-pro-catagory {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 25px !important;
        max-width: 1600px !important;
    }
}

/* Large Desktop (1400-1599px) - 4 columns */
@media (min-width: 1400px) and (max-width: 1599px) {
    .amado-pro-catagory {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 22px !important;
    }
}

/* Desktop (1200-1399px) - 3 columns */
@media (min-width: 1200px) and (max-width: 1399px) {
    .amado-pro-catagory {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }
}

/* Laptop (992-1199px) - 3 columns */
@media (min-width: 992px) and (max-width: 1199px) {
    .amado-pro-catagory {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px !important;
    }
}

/* Tablet (768-991px) - 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
    .amado-pro-catagory {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Mobile Landscape (576-767px) - 2 columns */
@media (min-width: 576px) and (max-width: 767px) {
    .amado-pro-catagory {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        padding: 4px !important;
    }

    .single-products-catagory .product-image-container {
        padding-bottom: 130% !important;
    }
}

/* Mobile Portrait (<576px) - 2 columns BIGGER */
@media (max-width: 575px) {
    .products-catagories-area {
        padding: 5px !important;
    }

    .amado-pro-catagory {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 5px !important;
        padding: 0 !important;
    }

    .single-products-catagory {
        border-radius: 8px !important;
    }

    .single-products-catagory .product-image-container {
        padding-bottom: 140% !important;
    }
}

/* Small Phones (<375px) - 2 columns EVEN BIGGER */
@media (max-width: 374px) {
    .amado-pro-catagory {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px !important;
        padding: 0 !important;
    }

    .single-products-catagory .product-image-container {
        padding-bottom: 150% !important;
    }
}

/* ========================================
   7. Product Cards
   ======================================== */

.single-products-catagory {
    overflow: hidden;
    border-radius: 15px;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
    margin: 0;
    padding: 0;
}

.single-products-catagory:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.single-products-catagory>a {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

/* Product Image Container - Square Aspect Ratio */
.single-products-catagory .product-image-container {
    display: block;
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-bottom: 120%;
    /* Taller aspect ratio for products */
    background: #f8f9fa;
}

/* Product Image */
.single-products-catagory .product-image-container img,
.single-products-catagory img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
    display: block;
}

.single-products-catagory:hover img {
    transform: scale(1.05);
}

/* Product Hover Content */
.single-products-catagory .hover-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
    color: #fff;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    direction: rtl;
}

.single-products-catagory .hover-content .line {
    width: 40px;
    height: 3px;
    background: #fbb710;
    margin: 0 auto 8px;
    border-radius: 2px;
}

.single-products-catagory .hover-content p {
    font-size: 13px;
    color: #ffd54f;
    margin: 0 0 6px 0;
    font-weight: 700;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

.single-products-catagory .hover-content h4 {
    font-size: 15px;
    color: #fff;
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

/* Mobile - smaller cards with compact overlay */
@media (max-width: 767px) {
    .single-products-catagory .product-image-container {
        padding-bottom: 100%;
        /* Square ratio on mobile */
    }

    .single-products-catagory .hover-content {
        padding: 10px 8px;
    }

    .single-products-catagory .hover-content .line {
        width: 30px;
        height: 2px;
        margin-bottom: 5px;
    }

    .single-products-catagory .hover-content p {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .single-products-catagory .hover-content h4 {
        font-size: 12px;
        line-height: 1.2;
    }
}

@media (max-width: 374px) {
    .single-products-catagory .hover-content {
        padding: 8px 6px;
    }

    .single-products-catagory .hover-content .line {
        display: none;
    }

    .single-products-catagory .hover-content p {
        font-size: 10px;
        margin-bottom: 3px;
    }

    .single-products-catagory .hover-content h4 {
        font-size: 11px;
    }
}