/*
 * 3A+ Catalogue Stylesheet
 * طراحی مدرن و حرفه‌ای با الهام از وب‌سایت رسمی 3A+. تمامی تایپوگرافی در
 * این نسخه با قلم فارسی/لاتین «Vazirmatn» انجام می‌شود که به صورت
 * آنلاین از سرویس Google Fonts بارگذاری می‌گردد. این کار باعث هماهنگی
 * کامل خطوط فارسی و انگلیسی در افزونه می‌شود و نیاز به فونت‌های YekanBakhX
 * و Snapp را از بین می‌برد.
 */

/*
 * Font definitions
 *
 * All typography in the catalogue uses the Vazirmatn typeface.  The font is
 * loaded from Google Fonts using an @import statement so it doesn’t depend on
 * any assets hosted on the 3A+ website.  The import below requests both
 * regular (400) and bold (700) weights for modern browsers.  If Google
 * resources are blocked the system will gracefully fall back to sans-serif.
 */

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

/* CSS Variables for consistent theming */
:root {
    --threeap-primary: #0a3c61; /* Dark navy similar to site */
    --threeap-secondary: #d4af37; /* Gold accent */
    --threeap-bg: #f8f9fa; /* light background */
    --threeap-card-bg: #ffffff;
    --threeap-card-shadow: rgba(0, 0, 0, 0.08);
    --threeap-text: #202a3b;
    --threeap-text-light: #555;
}

/* Wrapper for entire catalogue.  Generous horizontal padding on desktop
   so text and cards do not sit against the box edge. */
.threeap-catalog-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 3rem;
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    text-align: right;
    background: var(--threeap-bg);
}

/* Hero section introducing the catalogue */
/*
 * Hero section introducing the catalogue.  Generous spacing and increased
 * right padding prevent text from colliding with container edges.  The
 * overall design aims to feel premium and spacious, reflecting the
 * attention to detail in 3A Plus products.  RTL alignment is preserved
 * automatically by the surrounding wrapper.
 */
/*
 * Hero section
 *
 * Increase the horizontal margins so the content does not sit flush against the
 * container edge.  The previous margin of 1rem on the left and right caused
 * the paragraphs and lists to visually collide with the card border (as
 * reported by the user).  Setting a 2rem margin on the left and right adds
 * roughly 32px of breathing room.  The padding values remain the same to
 * preserve the overall composition of the hero card.
 */
.threeap-hero-section {
    background: var(--threeap-card-bg);
    color: var(--threeap-primary);
    padding: 3rem 4rem 3rem 3.5rem;
    text-align: right;
    border-radius: 24px;
    box-shadow: 0 12px 32px var(--threeap-card-shadow);
    margin: 2.5rem 0;
    overflow: hidden;
}

/* Desktop: extra spacing so text is clearly away from edges */
@media (min-width: 1024px) {
    .threeap-catalog-wrapper {
        padding: 0 4rem;
    }
    .threeap-hero-section {
        padding: 3.5rem 5rem 3.5rem 4rem;
    }
    .threeap-product-wrapper {
        padding: 3rem 4rem;
    }
}

/* Responsive adjustments for small screens. */
@media (max-width: 768px) {
    .threeap-catalog-wrapper {
        padding: 0 1rem;
    }
    .threeap-hero-section {
        margin: 2rem 0;
        padding: 2rem 1.5rem;
    }
    .threeap-hero-section p,
    .threeap-hero-section ul {
        padding-left: 0;
    }
    .threeap-product-content {
        padding: 0;
    }
}
/* Main and secondary headings in the hero section.  Sizes have been
 * increased slightly and line‑heights loosened for a more elegant look. */
.threeap-hero-main-title {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    color: var(--threeap-primary);
    line-height: 1.2;
}
.threeap-hero-subtitle {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.6rem;
    color: var(--threeap-primary);
    line-height: 1.4;
}
.threeap-hero-section h3 {
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--threeap-primary);
    font-family: 'Vazirmatn', sans-serif;
}
.threeap-hero-section p {
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--threeap-text);
    margin-bottom: 1.2rem;
    padding-left: 0.5rem;
}
.threeap-hero-section ul {
    list-style: none;
    padding: 0 0 0 1rem;
    margin: 0 0 1.2rem;
    color: var(--threeap-text);
    font-size: 1rem;
    line-height: 1.9;
}
.threeap-hero-section ul li {
    position: relative;
    padding-right: 1.8rem;
    margin-bottom: 0.75rem;
}
.threeap-hero-section ul li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0.6rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--threeap-secondary);
}

/* Grid layout */
/* Product grid.  We fix a minimum column width so that even when a single item
   is displayed the grid doesn’t span the entire width; instead it leaves
   whitespace to mimic three columns. */
.threeap-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem 0.5rem;
}

/* Card styles */
.threeap-card {
    background: var(--threeap-card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 16px var(--threeap-card-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.threeap-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px var(--threeap-card-shadow);
}
.threeap-card-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}
.threeap-card-body {
    padding: 1.4rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.threeap-card-title {
    font-size: 1.3rem;
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: var(--threeap-primary);
    font-family: 'Vazirmatn', sans-serif;
}
.threeap-card-title a {
    color: inherit;
    text-decoration: none;
}
.threeap-card-title a:hover {
    text-decoration: underline;
}
.threeap-card-excerpt {
    font-size: 0.95rem;
    color: var(--threeap-text-light);
    flex: 1;
    line-height: 1.8;
    margin-bottom: 0.8rem;
}

/* Buttons */
.threeap-btn {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    font-family: 'Vazirmatn', sans-serif;
}
.threeap-btn-primary {
    background: var(--threeap-secondary);
    color: var(--threeap-primary);
    box-shadow: 0 4px 8px rgba(212, 175, 55, 0.2);
}
.threeap-btn-primary:hover {
    background: #b99322;
    box-shadow: 0 6px 14px rgba(212, 175, 55, 0.3);
    color: var(--threeap-primary);
}
.threeap-btn-ghost {
    background: transparent;
    color: var(--threeap-secondary);
    border: 1px solid var(--threeap-secondary);
}
.threeap-btn-ghost:hover {
    background: var(--threeap-secondary);
    color: var(--threeap-primary);
    box-shadow: 0 4px 8px rgba(212, 175, 55, 0.2);
}

.threeap-catalog-actions {
    padding: 2rem;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Category selection cards */
.threeap-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-top: 1rem;
}
.threeap-category-card {
    cursor: pointer;
    width: 100%;
    max-width: 380px;
    height: 260px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 40px var(--threeap-card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.threeap-category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px var(--threeap-card-shadow);
}
.threeap-category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.threeap-back-categories {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Single product page styles */
.threeap-product-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 3.5rem;
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    text-align: right;
    background: var(--threeap-bg);
}
.threeap-product-title {
    font-size: 2.1rem;
    margin-bottom: 1.2rem;
    text-align: center;
    color: var(--threeap-primary);
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
}
.threeap-product-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    margin-bottom: 1rem;
    border-radius: 12px;
}
.threeap-product-content {
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--threeap-text);
    padding: 0 0.75rem;
}
.threeap-product-content h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 0.7rem;
    color: var(--threeap-primary);
    font-weight: 600;
    font-family: 'Vazirmatn', sans-serif;
}
.threeap-product-content ul {
    list-style-type: disc;
    padding-right: 1.5rem;
    padding-left: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}
.threeap-product-content table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
    direction: rtl;
}
.threeap-product-content table th,
.threeap-product-content table td {
    border: 1px solid #e0e0e0;
    padding: 0.5rem 0.6rem;
    text-align: center;
}
.threeap-product-content table th {
    background: var(--threeap-primary);
    color: #fff;
}
.threeap-product-actions {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Gallery styles */
.threeap-gallery {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: 16px;
}
.threeap-gallery img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    border-radius: inherit;
    transition: opacity 0.4s ease;
}
.threeap-gallery img.active {
    display: block;
    opacity: 1;
}
.threeap-gallery button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(212, 175, 55, 0.8);
    color: var(--threeap-primary);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}
.threeap-gallery button:hover {
    background: rgba(212, 175, 55, 1);
}
.threeap-gallery-prev {
    right: auto;
    left: 1rem;
}
.threeap-gallery-next {
    right: 1rem;
    left: auto;
}

/* Product hero section with background image */
.threeap-product-hero {
    position: relative;
    height: 380px;
    width: 100%;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    margin-bottom: 2rem;
    overflow: hidden;
}
.threeap-product-hero::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(10, 60, 97, 0.8) 100%);
}
.threeap-product-title-overlay {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    margin: 0;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
    z-index: 2;
}