/* ========================================================
   CATEGORY & PRODUCT LISTING PAGE STYLES
   Cleaned & separated from category.blade.php
   ======================================================== */

.cat-page-wrapper {
        padding: 14px 0 60px 0;
        background: #ffffff;
        min-height: 80vh;
    }

    /* Top Header Row with Centered Category Identity (Matching Marked Design) */
    .cat-top-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 22px;
        position: relative;
        flex-wrap: wrap;
        gap: 16px;
    }
    .cat-top-back-col {
        flex: 0 0 auto;
    }
    .cat-top-spacer-col {
        flex: 0 0 100px;
    }

    /* Back Link */
    .cat-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        font-weight: 600;
        color: #334155;
        background: #ffffff;
        border: 1.5px solid #e2e8f0;
        padding: 8px 16px;
        border-radius: 8px;
        text-decoration: none !important;
        transition: all 0.18s ease;
    }
    .cat-back-btn:hover {
        color: #ea580c;
        border-color: #ea580c;
        background: #fff7ed;
    }

    /* Category Identity Header Positioned in Marked Center Area */
    .cat-header-identity {
        display: inline-flex;
        align-items: center;
        gap: 18px;
        margin: 0 auto;
        padding: 10px 24px;
        background: #f8fafc;
        border: 1.5px solid #e2e8f0;
        border-radius: 16px;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
    }
    .cat-avatar-box {
        width: 68px;
        height: 68px;
        border-radius: 14px;
        overflow: hidden;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .cat-avatar-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .cat-identity-text {
        text-align: left;
    }
    .cat-identity-title {
        font-size: 28px;
        font-weight: 800;
        color: #0f172a;
        margin: 0 0 2px 0;
        letter-spacing: -0.5px;
        line-height: 1.2;
    }
    .cat-identity-count {
        font-size: 14px;
        color: #64748b;
        margin: 0;
        font-weight: 500;
    }

    /* Horizontal Filter & Controls Bar */
    .cat-controls-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 28px;
        padding: 12px 18px;
        background: #f8fafc;
        border: 1.5px solid #edf2f7;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
        flex-wrap: wrap;
    }
    .cat-search-group {
        position: relative;
        width: 320px;
        max-width: 100%;
    }
    .cat-search-input {
        width: 100%;
        border: 1.5px solid #e2e8f0;
        border-radius: 8px;
        padding: 9px 14px 9px 38px;
        font-size: 14px;
        background: #ffffff;
        color: #0f172a;
        outline: none;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .cat-search-input:focus {
        border-color: #cbd5e1;
        box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.08);
    }
    .cat-search-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
        font-size: 13.5px;
    }

    .cat-actions-group {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    /* Sort Select */
    .cat-sort-select-wrap {
        position: relative;
        display: flex;
        align-items: center;
        background: #ffffff;
        border: 1.5px solid #e2e8f0;
        border-radius: 8px;
        padding: 0 12px;
        height: 42px;
    }
    .cat-sort-icon {
        color: #64748b;
        font-size: 13px;
        margin-right: 6px;
    }
    .cat-sort-select {
        border: none;
        outline: none;
        font-size: 14px;
        font-weight: 500;
        color: #334155;
        background: transparent;
        cursor: pointer;
    }

    /* Price Range */
    .cat-price-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .cat-price-input {
        width: 90px;
        height: 42px;
        border: 1.5px solid #e2e8f0;
        border-radius: 8px;
        padding: 6px 10px;
        font-size: 13.5px;
        outline: none;
        background: #ffffff;
        color: #0f172a;
        text-align: center;
        transition: border-color 0.2s ease;
    }
    .cat-price-input:focus {
        border-color: #cbd5e1;
    }
    .cat-price-dash {
        color: #94a3b8;
        font-weight: 600;
    }
    .btn-cat-apply {
        background: #ea580c;
        color: #ffffff;
        border: none;
        border-radius: 8px;
        height: 42px;
        padding: 0 18px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.18s ease;
    }
    .btn-cat-apply:hover {
        background: #c2410c;
    }

    /* View Toggle */
    .cat-view-toggle-wrap {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .btn-view-toggle {
        width: 42px;
        height: 42px;
        border-radius: 8px;
        border: 1.5px solid #e2e8f0;
        background: #ffffff;
        color: #475569;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.18s ease;
        font-size: 15px;
    }
    .btn-view-toggle.active {
        background: #ea580c;
        border-color: #ea580c;
        color: #ffffff;
    }

    /* Products Grid: 4 Columns on Desktop */
    .cat-products-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        width: 100%;
    }

    /* Product Card */
    .cat-prod-card {
        background: #ffffff;
        border-radius: 16px;
        border: 1px solid #edf2f7;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
        padding: 14px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        position: relative;
        overflow: hidden;
        transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    }
    .cat-prod-card::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: url('{{ asset("public/frontEnd/5644.avif") }}');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0.10;
        border-radius: 16px;
        z-index: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    .cat-prod-card:hover::before {
        opacity: 0.15;
    }
    .cat-prod-card > div,
    .cat-prod-btn-row {
        position: relative;
        z-index: 1;
    }
    .cat-prod-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.07);
        border-color: #cbd5e1;
    }

    /* Image Wrapper */
    .cat-prod-img-wrap {
        position: relative;
        width: 100%;
        aspect-ratio: 1 / 1;
        border-radius: 12px;
        overflow: hidden;
        background: #f8fafc;
        border: 1px solid #f1f5f9;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .cat-prod-img-wrap a {
        display: block;
        width: 100%;
        height: 100%;
    }
    .cat-prod-img-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.35s ease;
    }
    .cat-prod-card:hover .cat-prod-img-wrap img {
        transform: scale(1.04);
    }

    /* Discount Badge */
    .cat-discount-badge {
        position: absolute;
        top: 10px;
        right: 10px;
        background: #ea580c;
        color: #ffffff;
        font-size: 11.5px;
        font-weight: 700;
        padding: 3px 8px;
        border-radius: 6px;
        z-index: 2;
        box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3);
    }
    .cat-discount-badge.badge-red {
        background: #dc2626;
        box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
    }

    .cat-stockout-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        color: #ffffff;
        font-size: 13.5px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 3;
        border-radius: 12px;
        letter-spacing: 0.5px;
    }

    /* Product Title */
    .cat-prod-name {
        font-size: 14px;
        font-weight: 600;
        color: #1e293b;
        text-decoration: none !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.45;
        min-height: 40px;
        margin: 12px 0 8px 0;
        transition: color 0.15s ease;
    }
    .cat-prod-name:hover {
        color: #ea580c;
    }

    /* Price Row */
    .cat-prod-price-row {
        display: flex;
        align-items: baseline;
        gap: 8px;
        margin-bottom: 14px;
    }
    .cat-prod-price-new {
        color: #ea580c;
        font-size: 17px;
        font-weight: 700;
    }
    .cat-prod-price-old {
        color: #94a3b8;
        font-size: 13.5px;
        text-decoration: line-through;
    }

    /* Action Buttons */
    .cat-prod-btn-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: auto;
    }
    .btn-card-addcart {
        background: #ffffff;
        color: #334155;
        border: 1.5px solid #e2e8f0;
        border-radius: 8px;
        padding: 8px 10px;
        font-size: 13px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        cursor: pointer;
        transition: all 0.18s ease;
    }
    @media (hover: hover) and (pointer: fine) {
        .btn-card-addcart:hover {
            background: #f8fafc;
            border-color: #cbd5e1;
            color: #0f172a;
        }
    }
    .btn-card-buynow {
        background: #ea580c;
        color: #ffffff;
        border: none;
        border-radius: 8px;
        padding: 8px 10px;
        font-size: 13px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        cursor: pointer;
        transition: background 0.18s ease;
    }
    .btn-card-buynow:hover {
        background: #c2410c;
        box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3);
    }

    /* List View Mode */
    .cat-products-grid.list-view {
        grid-template-columns: 1fr !important;
    }
    .cat-products-grid.list-view .cat-prod-card {
        flex-direction: row;
        align-items: center;
        gap: 20px;
    }
    .cat-products-grid.list-view .cat-prod-img-wrap {
        width: 140px;
        flex-shrink: 0;
    }
    .cat-products-grid.list-view .cat-prod-info {
        flex: 1;
    }
    .cat-products-grid.list-view .cat-prod-btn-row {
        width: 220px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
    }

    /* Responsive */
    @media (max-width: 1199px) {
        .cat-products-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }
    @media (max-width: 768px) {
        .cat-top-header-row {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }
        .cat-header-identity {
            width: 100%;
            margin: 0;
            padding: 10px 16px;
            gap: 14px;
        }
        .cat-products-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        .cat-avatar-box {
            width: 60px;
            height: 60px;
        }
        .cat-identity-title {
            font-size: 24px;
        }
        .cat-search-group {
            width: 100%;
        }
        .cat-actions-group {
            width: 100%;
            justify-content: space-between;
        }
    }
    @media (max-width: 480px) {
        .cat-products-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
        .cat-prod-card {
            padding: 10px;
        }
        .cat-prod-btn-row {
            grid-template-columns: 1fr;
        }
        .btn-card-addcart, .btn-card-buynow {
            padding: 6px 8px;
            font-size: 12px;
        }
        .btn-card-addcart:hover,
        .btn-card-addcart:focus,
        .btn-card-addcart:focus-visible {
            background: #ffffff !important;
            border-color: #e2e8f0 !important;
            color: #334155 !important;
            box-shadow: none !important;
            outline: none !important;
        }
        .btn-card-addcart:active {
            background: #f1f5f9 !important;
        }
    }

/* ========================================================
   Styles extracted from categories.blade.php
   ======================================================== */

.all-categories-section {
        padding: 40px 0 60px 0;
        background: #fbfbfc;
        min-height: 80vh;
    }

    .all-cat-header-wrap {
        text-align: center;
        max-width: 650px;
        margin: 0 auto 40px auto;
    }

    .all-cat-main-title {
        font-size: 32px;
        font-weight: 800;
        color: #0f172a;
        margin-bottom: 10px;
        letter-spacing: -0.5px;
    }

    .all-cat-subtitle {
        font-size: 15px;
        color: #64748b;
        margin: 0;
        line-height: 1.5;
    }

    /* Category Card */
    .cat-showcase-card {
        background: #ffffff;
        border-radius: 16px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
        padding: 16px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        height: 100%;
    }

    .cat-showcase-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
        border-color: #cbd5e1;
    }

    /* Top Banner Box */
    .cat-banner-box {
        position: relative;
        width: 100%;
        height: 220px;
        border-radius: 12px;
        overflow: hidden;
        background: #1e293b;
    }

    .cat-banner-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
        transition: transform 0.4s ease;
    }

    .cat-showcase-card:hover .cat-banner-img {
        transform: scale(1.03);
    }

    /* Dark Overlay with Title and Count */
    .cat-banner-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: 18px 20px;
    }

    .cat-banner-title {
        color: #ffffff !important;
        font-size: 22px;
        font-weight: 700;
        margin: 0 0 3px 0;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .cat-banner-count {
        color: rgba(255, 255, 255, 0.85);
        font-size: 13.5px;
        font-weight: 400;
        margin: 0;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    }

    /* Featured Products */
    .cat-featured-section {
        margin-top: 16px;
    }

    .cat-featured-heading {
        font-size: 14.5px;
        font-weight: 700;
        color: #0f172a;
        margin-bottom: 12px;
    }

    .cat-featured-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .cat-product-thumb {
        position: relative;
        aspect-ratio: 1 / 1;
        border-radius: 10px;
        overflow: hidden;
        background: #f8fafc;
        border: 1px solid #f1f5f9;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        transition: border-color 0.2s ease, transform 0.2s ease;
    }

    .cat-product-thumb:hover {
        border-color: #cbd5e1;
        transform: translateY(-2px);
    }

    .cat-product-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .cat-product-empty {
        aspect-ratio: 1 / 1;
        border-radius: 10px;
        background: #f8fafc;
        border: 1px dashed #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #94a3b8;
        font-size: 12px;
    }

    /* Shop Category Button */
    .btn-shop-category-action {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        background: #ea580c;
        color: #ffffff !important;
        font-size: 15px;
        font-weight: 600;
        padding: 12px 20px;
        border-radius: 10px;
        text-decoration: none !important;
        margin-top: 18px;
        transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
        border: none;
    }

    .btn-shop-category-action:hover {
        background: #c2410c;
        box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
        color: #ffffff !important;
    }

    @media (max-width: 575px) {
        .all-categories-section {
            padding: 24px 0 40px 0;
        }
        .all-cat-main-title {
            font-size: 24px;
        }
        .cat-banner-box {
            height: 180px;
        }
        .cat-banner-title {
            font-size: 19px;
        }
        .cat-featured-grid {
            gap: 8px;
        }
    }