:root {
    --primary-color: #7a5c34;
    --primary-dark: #5d4528;
    --primary-light: #a78b61;
    --primary-gradient: linear-gradient(135deg, #7a5c34, #8c6d46);
    --secondary-color: #8a7352;
    --success-color: #2e8b57;
    --warning-color: #daa520;
    --info-color: #b8860b;
    --danger-color: #a52a2a;
    --light-bg: #f8f4ed;
    --dark-text: #3e2e1a;
    --light-text: #7a6d5a;
    --shadow: 0 5px 15px rgb(122 92 52 / 10%);
    --shadow-hover: 0 10px 25px rgb(122 92 52 / 15%);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff;
    color: #2F1B14;
    scroll-behavior: smooth;
    padding-top: 80px;
    line-height: 1.6;
    margin: 0;
}

.btn-callback {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 12px;
    font-size: .85rem;
    border-radius: 20px;
    background: transparent;
}

.btn-callback:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-custom {
    background: var(--primary-gradient);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    transition: all .3s ease;
    color: #fff;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgb(139 69 19 / 20%);
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgb(139 69 19 / 30%);
    color: #fff;
}

.breadcrumb-custom {
    background: #fff;
    padding: 15px 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--light-text);
}

.section-title {
    position: relative;
    margin-bottom: 40px;
    font-weight: 700;
    text-align: center;
    color: var(--dark-text);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

.category-card,
.service-card,
.product-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all .4s cubic-bezier(.25, .46, .45, .94);
    border: none;
    box-shadow: 0 4px 6px rgb(122 92 52 / 10%), 0 1px 3px rgb(122 92 52 / 8%);
    position: relative;
    margin: 0 auto;
    height: 200px;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    animation: cardAppear .3s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
    backface-visibility: hidden;
    will-change: transform;
    transform: translateZ(0);
}

.category-card:hover,
.service-card:hover,
.product-card:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: 0 20px 40px rgb(122 92 52 / 15%), 0 8px 16px rgb(122 92 52 / 10%);
}

.category-img-container,
.service-card .card-img-container,
.product-card .card-img-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    z-index: 1;
}

.category-img-container::after,
.service-card .card-img-container::after,
.product-card .card-img-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgb(0 0 0 / 10%) 0%, rgb(0 0 0 / 30%) 50%, rgb(0 0 0 / 60%) 100%);
    z-index: 1;
    opacity: .8;
    transition: opacity .3s ease;
}

.category-content,
.service-card .card-body,
.product-card .card-body {
    position: absolute;
    inset: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    z-index: 2;
    background: transparent;
}

.category-title,
.service-card .card-title,
.product-card .card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.3;
    text-shadow: 2px 2px 4px rgb(0 0 0 / 70%);
    width: 100%;
}

.category-meta,
.service-actions,
.product-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.category-meta .btn-explore,
.service-actions .btn-details,
.service-actions .btn-request,
.product-actions .btn-details,
.product-actions .btn-order {
    background: rgb(255 255 255 / 90%);
    color: var(--primary-color);
    border: 2px solid #fff;
    padding: 10px 15px;
    border-radius: 25px;
    font-weight: 600;
    transition: all .3s ease;
    font-size: .9rem;
    box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
    backdrop-filter: blur(10px);
    white-space: normal;
    word-break: break-word;
    text-align: center;
    line-height: 1.2;
    max-width: 180px;
}

.category-meta .btn-explore:hover,
.service-actions .btn-details:hover,
.service-actions .btn-request:hover,
.product-actions .btn-details:hover,
.product-actions .btn-order:hover {
    background: #fff;
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgb(0 0 0 / 40%);
}

.category-img-container img,
.service-card .card-img-container img,
.product-card .card-img-container img {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
    transition: all .4s ease;
    filter: brightness(.95) contrast(1.05);
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: opacity 0.2s ease;
}

.category-img-container img.loaded,
.service-card .card-img-container img.loaded, 
.product-card .card-img-container img.loaded {
    opacity: 1 !important;
    animation: none !important;
}

.product-count {
    background: var(--primary-gradient);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgb(122 92 52 / 20%);
    transition: all .3s ease;
}

.product-count:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgb(122 92 52 / 30%);
}

.product-price,
.service-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 2px 2px 4px rgb(0 0 0 / 70%);
}

.featured-badge,
.service-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(45deg, var(--warning-color), var(--info-color));
    color: #fff;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: .75rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 4px 12px rgb(218 165 32 / 30%);
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.category-card:nth-child(1),
.service-card:nth-child(1),
.product-card:nth-child(1) { --animation-order: 1; }
.category-card:nth-child(2),
.service-card:nth-child(2),
.product-card:nth-child(2) { --animation-order: 2; }
.category-card:nth-child(3),
.service-card:nth-child(3),
.product-card:nth-child(3) { --animation-order: 3; }
.category-card:nth-child(4),
.service-card:nth-child(4),
.product-card:nth-child(4) { --animation-order: 4; }
.category-card:nth-child(5),
.service-card:nth-child(5),
.product-card:nth-child(5) { --animation-order: 5; }
.category-card:nth-child(6),
.service-card:nth-child(6),
.product-card:nth-child(6) { --animation-order: 6; }

img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.product-image-container {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgb(139 69 19 / 10%);
}

.product-image {
    border-radius: 8px;
    box-shadow: 0 8px 25px rgb(139 69 19 / 15%);
}

img:not(.loaded) {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 .2rem rgb(90 75 218 / 25%);
}

.form-check-input:checked {
    background-color: #8B4513;
    border-color: #8B4513;
}

.form-check-label {
    font-size: .875rem;
    color: #8B7355;
}

.card-body {
    background: #fff;
}

.card-title {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: .75rem;
}

.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    flex-direction: column;
    gap: 15px;
    color: var(--secondary-color);
    background: #fff;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--light-text);
}

.empty-state i {
    font-size: 3rem;
    color: #D2B48C;
    margin-bottom: 15px;
}

.empty-state h4 {
    color: #654321;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state p {
    font-size: 1.1rem;
}

.service-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.btn-details {
    background: rgb(255 255 255 / 90%);
    color: var(--primary-color);
    border: 2px solid #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all .3s ease;
    font-size: .9rem;
    box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
    backdrop-filter: blur(10px);
}

.btn-request {
    background: rgb(255 255 255 / 90%);
    color: var(--info-color);
    border: 2px solid #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: all .3s ease;
    font-size: .9rem;
    box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
    backdrop-filter: blur(10px);
}

.btn-details:hover,
.btn-request:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgb(0 0 0 / 40%);
}

.btn-details:hover {
    color: var(--primary-dark);
}

.btn-request:hover {
    color: var(--info-color);
}

.categories-grid,
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
    min-height: 200px;
    position: relative;
}

.categories-grid .category-card,
.services-grid .service-card {
    margin: 0;
    height: 200px;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.image-loading-spinner {
    display: none !important;
}

@media (width <= 768px) {
    .category-card,
    .service-card,
    .product-card {
        height: 200px !important;
        min-height: 200px !important;
        overflow: hidden !important;
    }
    
    .category-img-container,
    .service-card .card-img-container,
    .product-card .card-img-container {
        height: 100% !important;
        position: absolute !important;
        inset: 0 !important;
    }
    
    .category-img-container img,
    .service-card .card-img-container img,
    .product-card .card-img-container img {
        height: 100% !important;
        min-height: 100% !important;
        object-fit: cover !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
    }
    
    .category-content,
    .service-card .card-body,
    .product-card .card-body {
        height: 100% !important;
        position: absolute !important;
        inset: 0 !important;
        padding: 20px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        z-index: 2 !important;
    }
    
    .category-meta .btn-explore,
    .service-actions .btn-details,
    .service-actions .btn-request,
    .product-actions .btn-details,
    .product-actions .btn-order {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        max-width: 160px !important;
    }
}

@media (width <= 576px) {
    .category-card,
    .service-card,
    .product-card {
        height: 180px !important;
        min-height: 180px !important;
    }
    
    .category-content,
    .service-card .card-body,
    .product-card .card-body {
        padding: 15px !important;
    }
    
    .category-title,
    .service-card .card-title,
    .product-card .card-title {
        font-size: 1.2rem !important;
        margin-bottom: 10px !important;
    }
    
    .category-meta,
    .service-actions,
    .product-actions {
        gap: 8px !important;
    }
    
    .category-meta .btn-explore,
    .service-actions .btn-details,
    .service-actions .btn-request,
    .product-actions .btn-details,
    .product-actions .btn-order {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
        max-width: 140px !important;
    }
}

@media (width <= 480px) {
    .category-card,
    .service-card,
    .product-card {
        height: 160px !important;
        min-height: 160px !important;
    }
    
    .category-content,
    .service-card .card-body,
    .product-card .card-body {
        padding: 12px !important;
    }
    
    .category-title,
    .service-card .card-title,
    .product-card .card-title {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
    }
    
    .category-meta,
    .service-actions,
    .product-actions {
        gap: 6px !important;
    }
    
    .category-meta .btn-explore,
    .service-actions .btn-details,
    .service-actions .btn-request,
    .product-actions .btn-details,
    .product-actions .btn-order {
        padding: 5px 8px !important;
        font-size: 0.75rem !important;
        max-width: 120px !important;
    }
}

@media (width <= 360px) {
    .category-card,
    .service-card,
    .product-card {
        height: 150px !important;
        min-height: 150px !important;
    }
    
    .category-title,
    .service-card .card-title,
    .product-card .card-title {
        font-size: 1rem !important;
        margin-bottom: 6px !important;
    }
    
    .category-meta .btn-explore,
    .service-actions .btn-details,
    .service-actions .btn-request,
    .product-actions .btn-details,
    .product-actions .btn-order {
        padding: 4px 6px !important;
        font-size: 0.7rem !important;
        max-width: 110px !important;
    }
}

@media (width <= 1024px) and (width >= 768px) {
    .service-card .card-body {
        padding: 15px !important;
        justify-content: flex-end !important;
        align-items: center !important;
    }
    
    .service-card .card-title {
        font-size: 1.2rem !important;
        margin-bottom: 10px !important;
        line-height: 1.3 !important;
        max-height: 2.6em !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        text-overflow: ellipsis !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .service-price {
        font-size: 1.1rem !important;
        margin-bottom: 15px !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .service-actions {
        gap: 8px !important;
        width: 100% !important;
        justify-content: center !important;
    }
    
    .service-actions .btn-details,
    .service-actions .btn-request {
        padding: 8px 16px !important;
        font-size: .85rem !important;
        min-width: 120px !important;
    }
}

.loading-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}