/**
 * Doors Starter - Category Components Styles
 * Version: 1.5.0
 */

/* ====== Hero Section ====== */
.ds-category-hero {
    position: relative;
    padding: 80px 20px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-align: center;
    overflow: hidden;
}

.ds-category-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.5), rgba(0,0,0,0.3));
    z-index: 1;
}

.ds-category-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    color: #fff;
}

.ds-category-hero-h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin: 0 0 15px;
    line-height: 1.2;
    color: #fff;
}

.ds-category-hero-subtitle {
    font-size: 1.35rem;
    font-weight: 500;
    margin: 0 0 20px;
    opacity: 0.95;
}

.ds-category-hero-intro {
    font-size: 1.1rem;
    line-height: 1.65;
    max-width: 750px;
    margin: 0 auto;
    opacity: 0.95;
}

.ds-category-hero-intro p {
    margin: 0 0 12px;
}

@media (max-width: 768px) {
    .ds-category-hero { padding: 50px 15px; }
    .ds-category-hero-h1 { font-size: 2rem; }
    .ds-category-hero-subtitle { font-size: 1.1rem; }
    .ds-category-hero-intro { font-size: 1rem; }
}

/* ====== Table of Contents ====== */
.ds-category-toc {
    background: #f7f9fc;
    border-right: 4px solid var(--e-global-color-primary, #0073aa);
    padding: 20px 25px;
    margin: 30px 0;
    border-radius: 4px;
}

.ds-toc-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #333;
}

.ds-toc-list {
    list-style: decimal;
    padding-inline-start: 20px;
    margin: 0;
}

.ds-toc-item {
    margin-bottom: 6px;
}

.ds-toc-item a {
    color: var(--e-global-color-primary, #0073aa);
    text-decoration: none;
    transition: color 0.2s;
}

.ds-toc-item a:hover {
    color: var(--e-global-color-secondary, #005177);
    text-decoration: underline;
}

/* ====== Breadcrumbs ====== */
.ds-breadcrumbs {
    padding: 12px 0;
    font-size: 0.9rem;
}

.ds-breadcrumbs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ds-breadcrumb-item a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.ds-breadcrumb-item a:hover {
    color: var(--e-global-color-primary, #0073aa);
    text-decoration: underline;
}

.ds-breadcrumb-item:last-child span {
    color: #333;
    font-weight: 500;
}

.ds-breadcrumb-separator {
    color: #999;
    font-size: 0.8rem;
}

/* ====== Sub-Categories Grid ====== */
.ds-category-children {
    margin: 40px 0;
}

.ds-children-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 25px;
    text-align: center;
}

.ds-children-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(3, 1fr);
}

.ds-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ds-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .ds-children-grid,
    .ds-cols-3,
    .ds-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .ds-children-grid,
    .ds-cols-2,
    .ds-cols-3,
    .ds-cols-4 { grid-template-columns: 1fr; }
}

.ds-child-card {
    display: block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.ds-child-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.1);
    border-color: var(--e-global-color-primary, #0073aa);
}

.ds-child-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f5f5f5;
}

.ds-child-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.ds-child-card:hover .ds-child-image img {
    transform: scale(1.05);
}

.ds-child-content {
    padding: 20px;
}

.ds-child-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #222;
}

.ds-child-subtitle,
.ds-child-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
    margin: 0 0 10px;
}

.ds-child-count {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--e-global-color-primary, #0073aa);
    font-weight: 500;
}

/* ====== Comparison Table ====== */
.ds-category-comparison {
    margin: 50px 0;
}

.ds-comparison-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 20px;
    text-align: center;
}

.ds-comparison-wrap {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ds-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.ds-comparison-table th {
    background: var(--e-global-color-primary, #0073aa);
    color: #fff;
    padding: 14px 18px;
    text-align: start;
    font-weight: 700;
}

.ds-comparison-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.ds-comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.ds-comparison-table tbody tr:hover {
    background: #f9fafb;
}

.ds-cmp-model {
    font-weight: 600;
    color: #222;
}

.ds-cmp-price {
    color: var(--e-global-color-primary, #0073aa);
    font-weight: 500;
}

/* ====== Gallery ====== */
.ds-category-gallery {
    margin: 50px 0;
}

.ds-gallery-grid {
    display: grid;
    gap: 18px;
}

.ds-gallery-item {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    transition: transform 0.25s, box-shadow 0.25s;
}

.ds-gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* Catalog-only items (no products attached) - pure image, no card */
.ds-gallery-item--catalog {
    background: transparent;
    border: none;
    border-radius: 0;              /* no rounded corners */
    overflow: hidden;
}

.ds-gallery-item--catalog:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.ds-gallery-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 6px;
}

.ds-gallery-image img {
    width: 100%;
    height: 100%;
    /* Fit entire image without cropping - shows full product image even on tall doors */
    object-fit: contain;
    background: transparent;
    transition: transform 0.4s;
}

/* Catalog gallery grid: 2 columns by default, natural image dimensions (no aspect lock) */
.ds-gallery-grid--catalog {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 600px) {
    .ds-gallery-grid--catalog { grid-template-columns: 1fr; }
}

/* Catalog images: natural sizing, no aspect-ratio, no rounding */
.ds-gallery-item--catalog .ds-gallery-image {
    aspect-ratio: auto;            /* allow natural image dimensions */
    border-radius: 0;              /* no rounding on container */
    background: transparent;
    overflow: visible;
}

.ds-gallery-item--catalog .ds-gallery-image img {
    /* Use full natural size - no cropping, no aspect lock */
    object-fit: initial;
    height: auto;
    background: transparent;
    border-radius: 0;
    display: block;
}

.ds-gallery-item:hover .ds-gallery-image img {
    transform: scale(1.03);
}

/* Don't scale catalog images on hover - keep them clean */
.ds-gallery-item--catalog:hover .ds-gallery-image img {
    transform: none;
}

.ds-gallery-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    padding: 12px;
    text-align: center;
    color: #333;
}

/* ====== Price Range ====== */
.ds-category-price-range {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: #f7f9fc;
    border-radius: 30px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.ds-price-label {
    font-weight: 600;
    color: #555;
}

.ds-price-values {
    color: var(--e-global-color-primary, #0073aa);
    font-weight: 700;
    font-size: 1.05rem;
}

.ds-price-note {
    color: #999;
    font-size: 0.85rem;
}

/* ====== Section Title (shared by products + gallery) ====== */
.ds-category-section-title {
    font-size: 2rem !important;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 30px;
    text-align: right;
    color: var(--e-global-color-secondary, #0F192E);
}

/* ====== Products Loop ====== */
.ds-category-products {
    margin: 50px 0;
}

.ds-products-grid {
    display: grid;
    gap: 25px;
    --ds-card-aspect: 1/1;
}

.ds-product-card {
    background: transparent;       /* no white bg */
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
}

.ds-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.ds-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Default image container: square aspect, transparent bg */
.ds-product-image {
    aspect-ratio: var(--ds-card-aspect, 1 / 1);
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Default fit: cover (uniform appearance even if sources differ) */
.ds-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

/* Smart fit modes - controlled by [data-fit] on .ds-category-products */
.ds-category-products[data-fit="cover"] .ds-product-image img {
    object-fit: cover;
}

.ds-category-products[data-fit="contain"] .ds-product-image img {
    object-fit: contain;
}

/* Auto mode: each card gets its natural aspect class
 * - is-square / is-landscape: cover works fine (small/no crop)
 * - is-portrait: contain (don't crop tall doors)
 */
.ds-category-products[data-fit="auto"] .ds-product-card.is-square .ds-product-image img,
.ds-category-products[data-fit="auto"] .ds-product-card.is-landscape .ds-product-image img {
    object-fit: cover;
}

.ds-category-products[data-fit="auto"] .ds-product-card.is-portrait .ds-product-image img {
    object-fit: contain;
}

.ds-product-card:hover .ds-product-image img {
    transform: scale(1.05);
}

.ds-product-body {
    padding: 18px;
    background: #fff;              /* keep body white for text readability */
}

.ds-product-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #222;
}

.ds-product-price-range {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f4ff;
    color: var(--e-global-color-primary, #0073aa);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.ds-product-warranty {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 0.85rem;
}

.ds-product-warranty .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    color: #4caf50;
}

/* ====== CTA Box ====== */
.ds-category-cta {
    margin: 50px 0;
    padding: 40px 30px;
    background: linear-gradient(135deg, var(--e-global-color-primary, #0073aa), var(--e-global-color-secondary, #005177));
    border-radius: 10px;
    color: #fff;
    text-align: center;
}

.ds-cta-inner {
    max-width: 650px;
    margin: 0 auto;
}

.ds-cta-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #fff;
}

.ds-cta-text {
    font-size: 1.05rem;
    opacity: 0.95;
    margin: 0 0 20px;
}

.ds-cta-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.ds-cta-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: ds-pulse 2s infinite;
}

.ds-cta-status.is-open .ds-cta-dot {
    background: #4caf50;
    box-shadow: 0 0 0 rgba(76, 175, 80, 0.7);
}

.ds-cta-status.is-closed .ds-cta-dot {
    background: #ef5350;
    animation: none;
}

@keyframes ds-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
}

.ds-cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.ds-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
}

.ds-cta-phone {
    background: #fff;
    color: var(--e-global-color-primary, #0073aa);
}

.ds-cta-phone:hover {
    transform: scale(1.05);
    background: #f0f4ff;
}

.ds-cta-whatsapp {
    background: #25d366;
    color: #fff;
}

.ds-cta-whatsapp:hover {
    transform: scale(1.05);
    background: #20bd5a;
}

/* ====== No Products Message ====== */
.ds-no-products {
    padding: 40px;
    text-align: center;
    background: #f7f9fc;
    border-radius: 8px;
    color: #666;
}


/* ==========================================================================
   Helper: Uniform image sizing for any Elementor Loop Grid / generic container
   
   Usage:
   1. Add `ds-uniform-images` to the CSS Classes of an Elementor Loop Grid widget
      (Advanced tab → CSS Classes)
   2. Or wrap any custom gallery in a container with this class
   
   Variables (override per usage):
   --ds-uniform-aspect: aspect-ratio for images (default: 1/1)
   --ds-uniform-fit:    object-fit value (default: cover)
   --ds-uniform-bg:     image container background (default: transparent)
   ========================================================================== */
.ds-uniform-images {
    --ds-uniform-aspect: 1 / 1;
    --ds-uniform-fit: cover;
    --ds-uniform-bg: transparent;
}

/* Target Elementor Loop Grid image holders + common wrappers */
.ds-uniform-images .elementor-post__thumbnail,
.ds-uniform-images .elementor-post__thumbnail__link,
.ds-uniform-images .e-loop-item .elementor-element[data-element_type*="theme-post-featured-image"] .elementor-widget-container,
.ds-uniform-images .e-loop-item img,
.ds-uniform-images .swiper-slide img {
    aspect-ratio: var(--ds-uniform-aspect, 1 / 1) !important;
    overflow: hidden;
    background: var(--ds-uniform-bg, transparent);
}

.ds-uniform-images img {
    width: 100% !important;
    height: 100% !important;
    object-fit: var(--ds-uniform-fit, cover) !important;
}

/* For wrappers - keep image fully visible but uniform */
.ds-uniform-images .elementor-post__thumbnail img,
.ds-uniform-images .elementor-post__thumbnail__link img {
    width: 100% !important;
    height: 100% !important;
    object-fit: var(--ds-uniform-fit, cover) !important;
    display: block;
}

/* Contain variant: shows full image (whitespace if non-uniform) */
.ds-uniform-images.is-contain {
    --ds-uniform-fit: contain;
}

/* Wider aspect for landscape-heavy categories */
.ds-uniform-images.is-landscape {
    --ds-uniform-aspect: 4 / 3;
}

/* Tall aspect for door-heavy categories */
.ds-uniform-images.is-portrait {
    --ds-uniform-aspect: 3 / 4;
}

