/* Dynamic CSS variables will be set inline in the template */

.glide__track {
    overflow: hidden;
    width: 100%;
}

.glide__slides {
    backface-visibility: hidden;
    transform-style: preserve-3d;
    touch-action: pan-y;
    position: relative;
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
}

.glide__slide {
    backface-visibility: hidden;
    flex-shrink: 0;
    width: 100%;
    height: auto;
}

.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card .product-item {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: none;
}

.product-card:hover .product-item {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.product-card .card-img-top {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
    height: auto;
}

.product-card .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    min-height: 2.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color, #007bff);
    margin-top: auto;
}

.products-grid .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.products-grid .row > div {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-bottom: 1.5rem;
}

.webcommerce-shop {
    margin-top: 0;
    padding-top: 0;
}

.banner-carousel-section {
    margin-top: 0;
    padding-top: 0;
    margin-bottom: 3rem !important;
}

@media (max-width: 575.98px) {
    .banner-carousel-section {
        margin-top: 0;
        margin-bottom: 2rem !important;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .banner-carousel-section {
        margin-top: 0;
        margin-bottom: 2.5rem !important;
    }
}
#banner-carousel .glide__arrow {
    width: 28px;
    height: 28px;
    font-size: 1rem;
}

@media (max-width: 768px) {
    #banner-carousel .glide__arrow {
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
    }
}

@media (max-width: 575.98px) {
    #banner-carousel .glide__arrow {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
    }
}

@media (max-width: 575.98px) {
    .banner-carousel-section {
        padding-top: 1.5rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .banner-carousel-section {
        padding-top: 1.25rem;
    }
}

.banner-slide {
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

.banner-slide img {
    width: 100%;
    object-fit: cover;
    display: block;
    height: 450px !important;
}

@media (max-width: 575.98px) {
    .banner-slide img {
        height: 220px !important;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .banner-slide img {
        height: 280px !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .banner-slide img {
        height: 350px !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .banner-slide img {
        height: 400px !important;
    }
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.countdown-item {
    text-align: center;
}

.countdown-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
}

.countdown-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
}

.glide__bullet {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
}

.glide__bullet--active {
    background: white;
}

.flash-sale-products-section {
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.featured-products-section-wrapper:not(.featured-products-with-background) .featured-products-section {
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.flash-sale-products-section .carousel-container,
.featured-products-section .carousel-container {
    padding: 0 15px; 
    position: relative;
}

.glide__slide {
    height: auto;
    opacity: 1 !important;
    visibility: visible !important;
}

.glide__slides {
    display: flex;
    align-items: stretch;
}

.section-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
}

.section-header p {
    font-size: 0.95rem;
    color: #6c757d;
}

.flash-sale-products-section .product-card,
.featured-products-section .product-card {
    height: 100%;
}

.flash-sale-products-section .product-item,
.featured-products-section .product-item {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.flash-sale-products-section .card-body,
.featured-products-section .card-body {
    padding: 1rem !important;
    flex-grow: 1;
}

.flash-sale-products-section .product-name,
.featured-products-section .product-name {
    font-size: 0.95rem !important;
    line-height: 1.3;
    min-height: 2.5rem;
    margin-bottom: 0.5rem !important;
}

.flash-sale-products-section .product-brand,
.featured-products-section .product-brand {
    font-size: 0.75rem !important;
    margin-bottom: 0.5rem !important;
}

.flash-sale-products-section .product-rating,
.featured-products-section .product-rating {
    margin-bottom: 0.5rem !important;
}

.flash-sale-products-section .product-rating .stars,
.featured-products-section .product-rating .stars {
    font-size: 0.85rem !important;
}

.flash-sale-products-section .current-price,
.featured-products-section .current-price {
    font-size: 1.1rem !important;
}

.flash-sale-products-section .original-price,
.featured-products-section .original-price {
    font-size: 0.85rem !important;
}

.flash-sale-products-section .product-image,
.featured-products-section .product-image {
    height: 180px !important;
}

.carousel-container {
    padding: 0 15px;
}

.glide__arrow {
    display: none !important;
}

.glide__arrow:hover {
    background: var(--primary-color, #007bff);
    color: white;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.glide__arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.glide__arrow:disabled:hover {
    background: #ffffff;
    color: #495057;
    border-color: #dee2e6;
}

.glide__arrow--left {
    left: 0;
}

.glide__arrow--right {
    right: 0;
}

/* Featured products section */
.featured-products-section h3 {
    color: var(--primary-color, #007bff);
}

/* Search and Filter Section Below Banner */
.search-filter-section {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: 2rem;
}

.search-filter-wrapper {
    gap: 1rem;
}

.search-section {
    flex: 1;
    max-width: 600px;
}

.sort-options-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

/* Responsive Search and Filter */
@media (max-width: 767.98px) {
    .search-filter-section {
        padding: 1rem;
    }
    
    .search-section {
        max-width: 100%;
        width: 100%;
    }
    
    .sort-options-wrapper {
        width: 100%;
        justify-content: space-between;
    }
    
    .custom-select-dropdown {
        flex: 1;
        max-width: 100%;
    }
}

/* Responsive carousel padding */
@media (max-width: 768px) {
    .carousel-container {
        padding: 0 30px;
    }
    
    .glide__arrow {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
    }
    
    .flash-sale-products-section .product-image,
    .featured-products-section .product-image {
        height: 160px !important;
    }
    
    .flash-sale-products-section .product-name,
    .featured-products-section .product-name {
        font-size: 0.8rem !important;
        min-height: 2rem;
    }
    
    .flash-sale-products-section .current-price,
    .featured-products-section .current-price {
        font-size: 0.85rem !important;
    }
}/* Search Input Styling */
.search-form {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-btn {
    background: linear-gradient(45deg, var(--primary-color, #007bff), #0056b3);
    border: 2px solid var(--primary-color, #007bff);
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Category List Styling */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.category-item:hover {
    color: var(--primary-color, #007bff);
    background: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.1);
    transform: translateX(4px);
}

.category-item.active {
    background: linear-gradient(45deg, var(--primary-color, #007bff), #0056b3);
    color: white;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.category-name {
    flex: 1;
}

.category-count {
    background: #e9ecef;
    color: #6c757d;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.category-item {
    animation: slideIn 0.3s ease forwards;
}

/* Custom Select Dropdown Styling */
.custom-select-dropdown {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23495057' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    min-width: 200px;
}

.custom-select-dropdown:hover {
    border-color: var(--primary-color, #007bff);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transform: translateY(-1px);
}

.custom-select-dropdown:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1), 0 4px 12px rgba(0, 123, 255, 0.15);
}

.custom-select-dropdown option {
    padding: 0.75rem 1rem;
    background: #ffffff;
    color: #495057;
    font-weight: 500;
}

.custom-select-dropdown option:hover {
    background: var(--primary-color, #007bff);
    color: white;
}

/* Search Box Styling */
.search-box-container {
    max-width: 400px;
    margin: 0 auto;
}

.search-input {
    border-radius: 25px 0 0 25px !important;
    border-right: none !important;
    padding-left: 1rem !important;
}

.search-submit-btn {
    border-radius: 0 25px 25px 0 !important;
    border: 1px solid #ced4da !important;
    border-left: none !important;
    padding: 0.5rem 1rem !important;
    background-color: #f8f9fa !important;
    color: #6c757d !important;
}

.search-submit-btn:hover {
    border-color: #adb5bd !important;
    background-color: #e9ecef !important;
    color: #495057 !important;
}

.search-submit-btn:focus {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    background-color: #e9ecef !important;
}

/* Search Dropdown Styling */
#search-results-container {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1050 !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    margin-top: 2px !important;
}

.dropdown-item {
    border: none !important;
    padding: 0.75rem 1rem !important;
    transition: background-color 0.2s ease !important;
}

.dropdown-item:hover {
    background-color: #f8f9fa !important;
}

.recent-search:hover {
    background-color: #e9ecef !important;
}

/* ==========================================
   COMPREHENSIVE MOBILE RESPONSIVENESS
   ========================================== */

/* Flash sale countdown mobile improvements */
@media (max-width: 575.98px) {
    .banner-carousel-section {
        margin-bottom: 1.5rem !important;
    }

    .countdown-number {
        font-size: 1.25rem !important;
    }

    .countdown-label {
        font-size: 0.7rem !important;
    }

    .countdown-timer .row {
        gap: 0.25rem;
    }

    .countdown-item {
        min-width: 60px;
    }

    .flash-sale-banner {
        padding: 1.5rem !important;
    }

    .flash-sale-banner h3 {
        font-size: 1.25rem !important;
    }

    .flash-sale-banner p {
        font-size: 0.9rem !important;
    }

    .products-grid .row {
        margin: 0 -0.3rem;
    }

    .products-grid [class*="col-"] {
        padding: 0 0.3rem;
        margin-bottom: 0.6rem;
    }

    /* Mobile 2-column optimization like Tokopedia */
    .products-grid .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .product-card {
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        margin-bottom: 0;
    }

    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

    .product-card .card-body {
        padding: 0.6rem 0.4rem !important;
    }

    .product-card .product-image {
        height: auto !important;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }

    .product-card .product-name {
        font-size: 0.8rem !important;
        min-height: 2rem !important;
        max-height: 2.1rem !important;
        line-height: 1.25 !important;
        margin-bottom: 0.3rem !important;
    }

    .product-card .product-brand {
        font-size: 0.65rem !important;
        margin-bottom: 0.25rem !important;
    }

    .product-card .product-rating {
        min-height: 1rem !important;
        margin-bottom: 0.3rem !important;
    }

    .product-card .product-rating .stars {
        font-size: 0.7rem !important;
    }

    .product-card .product-pricing {
        padding-top: 0.3rem !important;
        margin-top: 0.25rem !important;
    }

    .product-card .current-price {
        font-size: 0.9rem !important;
    }

    .product-card .original-price {
        font-size: 0.75rem !important;
    }

    .product-card .card-img-top {
        border-radius: 8px 8px 0 0;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .pagination {
        font-size: 0.9rem;
    }

    .page-link {
        padding: 0.5rem 0.75rem;
    }

    .carousel-container {
        padding: 0 20px !important;
    }

    .glide__arrow {
        display: none !important;
    }
    
    /* Carousel shows 1 product on mobile - make it bigger and centered */
    .flash-sale-products-section .product-image,
    .featured-products-section .product-image {
        height: 200px !important;
    }

    /* Optimize carousel slides for mobile 1-column */
    #flash-sale-carousel .glide__slide,
    #featured-products-carousel .glide__slide {
        padding: 0;
    }

    #flash-sale-carousel .product-card,
    #featured-products-carousel .product-card {
        margin-bottom: 0;
        max-width: 100%;
    }
    
    .flash-sale-products-section .product-name,
    .featured-products-section .product-name {
        font-size: 0.9rem !important;
        min-height: 2.2rem;
    }
    
    .flash-sale-products-section .product-brand,
    .featured-products-section .product-brand {
        font-size: 0.75rem !important;
    }
    
    .flash-sale-products-section .product-rating .stars,
    .featured-products-section .product-rating .stars {
        font-size: 0.8rem !important;
    }
    
    .flash-sale-products-section .current-price,
    .featured-products-section .current-price {
        font-size: 1rem !important;
    }
    
    .flash-sale-products-section .original-price,
    .featured-products-section .original-price {
        font-size: 0.85rem !important;
    }

    /* Better spacing for single carousel product on mobile */
    .flash-sale-products-section .card-body,
    .featured-products-section .card-body {
        padding: 1rem !important;
    }
    
    .section-header h3 {
        font-size: 1.1rem !important;
    }
    
    .section-header p {
        font-size: 0.8rem !important;
    }
}

/* Section headers mobile */
@media (max-width: 767.98px) {
    .section-header h3 {
        font-size: 1.5rem !important;
    }

    .section-header p {
        font-size: 0.85rem !important;
    }

    .carousel-container {
        padding: 0 20px !important;
    }

    .glide__arrow {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.1rem !important;
    }

    .search-box-container {
        max-width: 100% !important;
    }

    .search-input {
        font-size: 0.9rem !important;
        padding: 0.6rem 1rem !important;
    }

    .search-submit-btn {
        padding: 0.6rem 1rem !important;
    }
}

@media (max-width: 991.98px) {
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }

    .flex-grow-1.mx-4 {
        margin: 0 !important;
        order: 2;
    }

    .sort-options {
        order: 3;
        align-self: stretch;
    }

    .sort-options::before {
        position: static;
        margin-bottom: 0.5rem;
        display: block;
    }

    .custom-select-dropdown {
        width: 100%;
        min-width: auto !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .d-flex.justify-content-between {
        flex-wrap: wrap;
        align-items: center !important;
        gap: 1rem;
    }

    .flex-grow-1.mx-4 {
        flex: 1 1 300px;
        margin: 0 !important;
        order: 2;
    }

    .sort-options {
        flex: 0 0 auto;
        order: 3;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .banner-slide img {
        height: 320px !important; 
    }

    .carousel-container {
        padding: 0 50px;
    }

    .glide__arrow {
        width: 50px;
        height: 50px;
        font-size: 1.75rem;
    }
}