/* Reset and base styles */
@import url('fontiran.css');

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

a {
    text-decoration: none;
}

body {
  -moz-font-feature-settings: 'ss02';
  -webkit-font-feature-settings: 'ss02';
  font-feature-settings: 'ss02';
    font-family: 'IRANSansX', Arial, sans-serif;
    background-color: #fafafa; /* neutral-50 */
    margin: 0;
    padding: 0;
    min-height: 100vh;
    direction: rtl;
}

/* Main app container */
.app {
    background-color: #fafafa; /* neutral-50 */
    min-height: 100vh;
    width: 100%;
}

.container {
    background-color: #f5f5f5; /* neutral-100 */
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* First Layer: Page Title */
.page-title {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 24px 0; /* py-6 */
}

.title-text {
    font-family: 'IRANSansX', Arial, sans-serif;
    font-size: 24px;
    color: #181d27;
    line-height: 32px;
    font-weight: 600;
    text-align: left;
}

/* Second Layer: Main Content */
.main-content {
    flex: 1;
    padding-bottom: 40px; /* pb-10 */
}

.product-grid {
    width: 100%;
    max-width: 1216px;
    margin: 0 auto;
    padding: 0 16px; /* px-4 */
}

/* Updated flexible grid container to match Tailwind behavior exactly */
.product-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px; /* gap-6 = 1.5rem = 24px */
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    position: relative;
}

/* Product Card - Updated to match Tailwind flexbox behavior */
.product-card {
    /* Equivalent to: basis-0 grow min-w-[232px] shrink-0 */
    /* Visual styling */
    max-width: 25% !important;
    background-color: #ffffff;
    border-radius: 16px; /* rounded-2xl */
    box-shadow: 0px 4px 6px -1px rgba(10, 13, 18, 0.1), 0px 2px 4px -2px rgba(10, 13, 18, 0.06);
    position: relative;
    min-height: 1px;
    
    /* Inner structure */
    display: flex;
    flex-direction: row;
    align-items: center;
}

.product-card-inner {
    display: flex;
    flex-direction: row;
    gap: 8px; /* gap-2 */
    align-items: center;
    justify-content: flex-start;
    min-width: inherit;
    padding: 16px; /* p-4 */
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.product-card-content {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    gap: 12px; /* gap-3 */
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 1px;
    min-width: 1px;
    padding: 0;
    position: relative;
}

.product-image {
    aspect-ratio: 1;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 8px; /* rounded-lg */
    width: 100%;
}

.product-content {
    display: flex;
    flex-direction: column;
    gap: 8px; /* gap-2 */
    align-items: flex-end;
    justify-content: flex-start;
    width: 100%;
    position: relative;
}

.product-title {
    height: 40px; /* h-10 */
    width: 100%;
    font-family: 'IRANSansX', Arial, sans-serif;
    font-size: 14px;
    color: #414651;
    text-align: right;
    line-height: 20px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 500; /* Medium weight */
    position: relative;
}

.product-price {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    direction: ltr !important;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 4px; /* gap-1 */
    justify-content: flex-start;
    position: relative;
}

.currency {
    font-family: 'IRANSansX', Arial, sans-serif;
    font-size: 12px;
    color: #717680;
    line-height: 16px;
    font-weight: 600; /* Demibold */
    white-space: pre;
    text-align: right;
    position: relative;
}

.price {
    font-family: 'IRANSansX', Arial, sans-serif;
    font-size: 14px;
    color: #181d27;
    line-height: 20px;
    font-weight: 700; /* Bold */
    white-space: pre;
    text-align: right;
    position: relative;
}

.original-price {
    font-family: 'IRANSansX', Arial, sans-serif;
    font-size: 14px;
    color: #a4a7ae;
    line-height: 18px;
    text-decoration: line-through;
    text-decoration-skip-ink: none;
    text-decoration-style: solid;
    text-underline-position: from-font;
    font-weight: 600; /* DemiBold */
    white-space: pre;
    text-align: right;
    position: relative;
}

.discount-badge {
    display: flex;
    flex-direction: row;
    gap: 3px;
    height: 20px; /* h-5 */
    align-items: flex-end;
    justify-content: center;
    padding: 0 4px; /* px-1 */
    position: relative;
    border-radius: 16px; /* rounded-2xl */
    border: 1px solid #fba39d;
    background-color: transparent;
}

.discount-badge-text {
    font-family: 'IRANSansX', Arial, sans-serif;
    font-size: 14px;
    color: #d43125;
    line-height: 18px;
    font-weight: 700; /* Bold */
    white-space: pre;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Badges - Updated positioning */
.badge-suggested {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ecfdf3;
    border: 1px solid #abefc6;
    border-radius: 9999px; /* rounded-full */
    padding: 2px 10px; /* px-2.5 py-0.5 */
    font-family: 'IRANSansX', Arial, sans-serif;
    font-size: 14px;
    color: #067647;
    line-height: 20px;
    font-weight: 500; /* Medium */
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: pre;
    text-align: center;
}

.badge-merchant {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #f9fafb; /* neutral-50 */
    border: 1px solid #e9eaeb;
    border-radius: 9999px; /* rounded-full */
    padding: 2px 10px; /* px-2.5 py-0.5 */
    font-family: 'IRANSansX', Arial, sans-serif;
    font-size: 14px;
    color: #414651;
    line-height: 20px;
    font-weight: 500; /* Medium */
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: pre;
    text-align: center;
}

/* Third Layer: Footer */
.footer {
    background-color: #0a0d12;
    width: 100%;
    padding: 16px 0; /* py-4 */
}

.footer-content {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 160px; /* px-40 */
}

.footer-inner {
    display: flex;
    align-items: flex-end;
    gap: 8px; /* gap-2 */
}

.logo {
    height: 24px; /* h-6 */
    width: 109px;
    overflow: hidden;
}

.logo svg {
    display: block;
    width: 100%;
    height: 100%;
}

.made-by-text {
    font-family: 'IRANSansX', Arial, sans-serif;
    font-size: 14px;
    color: #ffffff;
    line-height: 20px;
    font-weight: 600; /* Demibold */
}

/* Responsive Design - Much simpler approach */
@media (max-width: 768px) {
    .footer-content {
        padding: 0 16px; /* Reduce padding on mobile */
    }
    
    .product-grid {
        padding: 0 8px;
    }
    
    .product-cards-container {
        gap: 16px; /* Smaller gap on mobile */
    }
    
    .product-card {
        /* On mobile, cards take full width minus gap */
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .title-text {
        font-size: 20px;
        text-align: center;
    }
    
    .product-card-inner {
        padding: 12px;
    }
    
    .badge-suggested,
    .badge-merchant {
        font-size: 14px;
        padding: 1px 8px;
    }
    
    .product-cards-container {
        gap: 12px; /* Even smaller gap on small mobile */
    }
}

/* Key responsive breakpoints to match Tailwind behavior */
@media (min-width: 768px) {
    .product-card {
        /* Tablet: minimum 2 cards per row */
        flex: 1 1 calc(50% - 12px);
        min-width: 232px;
    }
}

@media (min-width: 1024px) {
    .product-card {
        /* Desktop: minimum 3-4 cards per row */
        flex: 1 1 calc(33.333% - 16px);
        min-width: 232px;
    }
}

@media (min-width: 1216px) {
    .product-card {
        /* Large desktop: 4-5 cards per row */
        flex: 1 1 calc(25% - 18px);
        min-width: 232px;
    }
}

@media (min-width: 1400px) {
    .product-card {
        /* Extra large: 5+ cards per row */
        flex: 1 1 calc(20% - 19.2px);
        min-width: 232px;
    }
}

/* RTL adjustments */
[dir="rtl"] .product-price {
    direction: rtl;
}

[dir="rtl"] .price-container {
    flex-direction: row-reverse;
}

/* Hover effects */
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0px 8px 16px -4px rgba(10, 13, 18, 0.15), 0px 4px 8px -2px rgba(10, 13, 18, 0.1);
    transition: all 0.2s ease-in-out;
}

/* Focus states for accessibility */
.product-card:focus-within {
    outline: 2px solid #067647;
    outline-offset: 2px;
}