/**
 * DeliSecret — Catalog styles
 */

/* === Root catalog showcase === */
.catalog-intro {
    max-width: 850px;
    margin: 0 auto 2rem;
    text-align: center;
}

.catalog-intro-kicker,
.showcase-section-kicker {
    margin: 0 0 0.4rem;
    color: #cc2d5a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.catalog-intro h1 {
    margin: 0 0 1rem;
    color: #111827;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.catalog-intro > p:not(.catalog-intro-kicker) {
    margin: 0 auto;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.75;
}

.catalog-intro-note {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.15rem;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    background: #fdf2f4;
    color: #8f1d40;
    font-size: 0.76rem;
    line-height: 1.35;
}

.catalog-intro-note .material-icons {
    font-size: 18px;
    flex: 0 0 auto;
}

.catalog-brand-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 3.5rem;
}

.catalog-brand-banner {
    position: relative;
    display: block;
    min-height: 230px;
    overflow: hidden;
    border-radius: 1.25rem;
    background-position: center 25%;
    background-size: cover;
    color: #fff;
    box-shadow: 0 8px 30px rgba(31, 41, 55, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.catalog-brand-banner.no-image {
    background: linear-gradient(135deg, #7a1c3b, #cc2d5a 55%, #f4a9bc);
}

.catalog-brand-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 38px rgba(31, 41, 55, 0.16);
}

.catalog-brand-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(17, 24, 39, 0.72), rgba(17, 24, 39, 0.12));
}

.catalog-brand-content {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1.75rem;
}

.catalog-brand-name {
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.catalog-brand-action,
.showcase-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.catalog-brand-action {
    margin-top: 0.65rem;
    color: rgba(255, 255, 255, 0.9);
}

.catalog-brand-action .material-icons,
.showcase-all-link .material-icons {
    font-size: 17px;
}

.catalog-showcase-list {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.showcase-products-section {
    min-height: 210px;
}

.showcase-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.showcase-section-header h2,
.showcase-section-preview h2 {
    margin: 0;
    color: #111827;
    font-size: clamp(1.25rem, 2.5vw, 1.7rem);
    font-weight: 700;
}

.showcase-all-link {
    flex: 0 0 auto;
    color: #cc2d5a;
    transition: color 0.15s ease;
}

.showcase-all-link:hover {
    color: #8f1d40;
}

.showcase-carousel-shell {
    position: relative;
}

.catalog-showcase-swiper {
    padding: 0.25rem 0.25rem 1.3rem;
    margin: -0.25rem;
}

.catalog-showcase-swiper .product-card {
    height: auto;
}

.showcase-nav {
    position: absolute;
    top: 37%;
    z-index: 5;
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid #f3f4f6;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    color: #374151;
    box-shadow: 0 6px 22px rgba(31, 41, 55, 0.15);
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, color 0.2s ease;
}

.showcase-nav:hover { color: #cc2d5a; }
.showcase-nav-prev { left: -20px; }
.showcase-nav-next { right: -20px; }
.showcase-nav.swiper-button-disabled { opacity: 0; pointer-events: none; }

.showcase-section-preview {
    padding: 1rem 0;
}

.showcase-section-preview p {
    margin: 0 0 0.35rem;
    color: #cc2d5a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.showcase-skeleton {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.showcase-skeleton div {
    aspect-ratio: 3 / 4.8;
    border-radius: 1rem;
    background: linear-gradient(90deg, #f5f5f5 25%, #fafafa 40%, #f5f5f5 65%);
    background-size: 400% 100%;
    animation: showcase-shimmer 1.3s ease infinite;
}

@keyframes showcase-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.showcase-load-error {
    display: flex;
    min-height: 150px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border-radius: 1rem;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.85rem;
}

.showcase-retry {
    padding: 0.55rem 1rem;
    border: 1px solid #f9d0db;
    border-radius: 999px;
    background: #fff;
    color: #cc2d5a;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
}

/* === Catalog layout === */
.catalog-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* === Sidebar === */
.catalog-sidebar {
    width: 330px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.catalog-sidebar::-webkit-scrollbar {
    width: 4px;
}

.catalog-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* === Category tree === */
.cat-tree-item {
    border-bottom: 1px solid #f3f4f6;
}

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

.cat-tree-l0 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.3;
    border-radius: 0.5rem;
}

.cat-tree-l0:hover {
    background: #fdf2f4;
    color: #cc2d5a;
}

.cat-tree-l0.active {
    background: #fdf2f4;
    color: #cc2d5a;
    font-weight: 600;
}

.cat-tree-l0 .cat-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: #9ca3af;
    font-size: 18px;
}

.cat-tree-l0 .cat-toggle.expanded {
    transform: rotate(180deg);
}

.cat-tree-l0 .cat-count {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 0.25rem;
    white-space: nowrap;
}

.cat-tree-l0 .cat-name {
    flex: 1;
    min-width: 0;
}

/* === L1 children === */
.cat-tree-children {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    max-height: 0;
    opacity: 0;
}

.cat-tree-children.open {
    max-height: 2000px;
    opacity: 1;
}

.cat-tree-l1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem 0.5rem 1.5rem;
    text-decoration: none;
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.3;
    transition: all 0.15s ease;
    border-radius: 0.375rem;
}

.cat-tree-l1:hover {
    color: #cc2d5a;
    background: #fdf2f4;
}

.cat-tree-l1.active {
    color: #cc2d5a;
    font-weight: 600;
    background: #fdf2f4;
}

.cat-tree-l1 .cat-count {
    font-size: 0.6875rem;
    color: #9ca3af;
    font-weight: 400;
    white-space: nowrap;
}

/* === Catalog content === */
.catalog-content {
    flex: 1;
    min-width: 0;
}

/* === Catalog header === */
.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.catalog-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.catalog-count {
    font-size: 0.875rem;
    color: #9ca3af;
    font-weight: 400;
}

/* === Sort dropdown === */
.catalog-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.catalog-sort label {
    font-size: 0.8125rem;
    color: #6b7280;
    white-space: nowrap;
}

.catalog-sort select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #374151;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.catalog-sort select:focus {
    outline: none;
    border-color: #cc2d5a;
    box-shadow: 0 0 0 2px rgba(204, 45, 90, 0.15);
}

/* === Products grid === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* === Product card === */
.product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #f3f4f6;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.card-image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card .card-image {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f9fafb;
}

.product-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .card-image .img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdf2f4 0%, #fce7ec 50%, #f9d0db 100%);
}

.product-card .card-image .img-placeholder .material-icons {
    color: #f4a9bc;
    font-size: 48px;
}

.product-card .card-label {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    z-index: 5;
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.625rem;
    font-weight: 500;
    border-radius: 0.25rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.product-card .card-badge-sale {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0.25rem;
    background: #ef4444;
    color: white;
    font-size: 0;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 9999px;
    letter-spacing: 0.025em;
    overflow: hidden;
    white-space: nowrap;
    transition: font-size 0.3s ease, padding 0.3s ease, gap 0.3s ease;
}

.product-card .card-badge-sale .material-icons {
    font-size: 12px;
}

.product-card:hover .card-badge-sale {
    font-size: 0.6875rem;
    padding: 0.25rem 0.625rem;
    gap: 0.25rem;
}

.product-card:hover .card-badge-sale .material-icons {
    font-size: 12px;
}

.product-card .card-body {
    padding: 0.75rem 1rem 1rem;
}

.product-card .card-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
    transition: color 0.15s ease;
}

.product-card:hover .card-name {
    color: #cc2d5a;
}

.product-card .card-price {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.product-card .card-price .price-current {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
}

.product-card .card-price .price-current.sale {
    color: #ef4444;
}

.product-card .card-price .price-original {
    font-size: 0.8125rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.product-card .card-colors {
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.color-swatch:hover {
    border-color: #cc2d5a;
    transform: scale(1.2);
}

.color-swatch.swatch-active {
    border-color: #cc2d5a;
    transform: scale(1.2);
}

.color-swatch.out-of-stock {
    opacity: 0.4;
    cursor: default;
}

.color-swatch-text {
    font-size: 0.625rem;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.color-swatch-text.swatch-active {
    background: #cc2d5a;
    color: white;
}

.color-more {
    font-size: 0.625rem;
    color: #9ca3af;
    margin-left: 2px;
    white-space: nowrap;
}

/* === Delayed automatic loading / Load More === */
.load-more-wrap {
    text-align: center;
    padding: 1.5rem 0;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #cc2d5a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 12rem;
    padding: 0.75rem 2rem;
    background: white;
    border: 2px solid #cc2d5a;
    border-radius: 0.75rem;
    color: #cc2d5a;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background: #cc2d5a;
    color: white;
}

.load-more-btn:focus-visible {
    outline: 3px solid rgba(204, 45, 90, 0.25);
    outline-offset: 3px;
}

.load-more-btn:active {
    transform: translateY(1px);
}

.catalog-pagination-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 0 2rem;
}

.catalog-pagination-links a {
    color: #cc2d5a;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.25rem;
}

.catalog-pagination-links a:hover {
    color: #9f1239;
}

/* === Empty state === */
.catalog-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.catalog-empty .material-icons {
    font-size: 64px;
    color: #e5e7eb;
    margin-bottom: 1rem;
}

.catalog-empty h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.catalog-empty p {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* === Responsive === */
@media (max-width: 1023px) {
    .showcase-nav { display: none; }

    .catalog-layout {
        flex-direction: column;
    }

    .catalog-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        display: none;
    }

    .catalog-sidebar.mobile-open {
        display: block;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }
}

@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.875rem;
    }
}

@media (max-width: 639px) {
    .catalog-intro { margin-bottom: 1.5rem; }
    .catalog-intro-note { border-radius: 0.85rem; text-align: left; }
    .catalog-brand-grid { grid-template-columns: 1fr; gap: 0.9rem; margin-bottom: 2.75rem; }
    .catalog-brand-banner { min-height: 175px; }
    .catalog-brand-content { padding: 1.25rem; }
    .catalog-showcase-list { gap: 2.75rem; }
    .showcase-products-section { min-height: 170px; }
    .showcase-section-header { align-items: center; }
    .showcase-all-link { font-size: 0; gap: 0; }
    .showcase-all-link .material-icons { font-size: 23px; }
    .showcase-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .showcase-skeleton div:nth-child(n+3) { display: none; }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-card .card-body {
        padding: 0.5rem 0.625rem 0.75rem;
    }

    .product-card .card-name {
        font-size: 0.75rem;
    }

    .product-card .card-price .price-current {
        font-size: 0.8125rem;
    }

    .catalog-header h1 {
        font-size: 1.25rem;
    }
}
