/* ============================================================
   custom.css — Category Grid (Mobile Toggle) & Unified Product Cards
   ============================================================ */

/* ===== CATEGORY GRID ===== */
.category-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px 10px;
}

.category-grid-item {
    text-align: center;
    padding: 8px 4px;
}

.category-grid-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.cat-icon-wrap {
    width: 86px;
    height: 86px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.category-grid-item:hover .cat-icon-wrap {
    background: #efefef;
    transform: translateY(-2px);
}

.cat-icon-wrap img {
    max-width: 66px;
    max-height: 66px;
    object-fit: contain;
}

.cat-name {
    font-size: 12px;
    color: #222;
    margin: 0;
    line-height: 1.35;
    font-weight: 500;
    word-break: break-word;
}

/* PC: Show all categories, hide toggle button */
.cat-toggle-wrap {
    display: none;
}

/* Mobile: 3 columns, 2 lines (6 items) initially + toggle button */
@media (max-width: 767px) {
    .category-grid-wrapper {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px 8px;
    }

    .category-grid-wrapper:not(.expanded) .cat-extra-mobile {
        display: none;
    }

    .cat-toggle-wrap {
        display: block;
        text-align: center;
        margin-top: 8px;
        margin-bottom: 12px;
    }

    .cat-toggle-btn {
        background: none;
        border: none;
        font-weight: 700;
        font-size: 15px;
        text-decoration: underline;
        text-underline-offset: 4px;
        cursor: pointer;
        color: #111;
        padding: 6px 14px;
    }

    .cat-icon-wrap {
        width: 76px;
        height: 76px;
        border-radius: 10px;
    }

    .cat-icon-wrap img {
        max-width: 56px;
        max-height: 56px;
    }

    .cat-name {
        font-size: 12px;
    }
}


/* ===== UNIFIED PRODUCT CARDS ===== */

/* Ensure Owl Carousel items stretch to equal height and don't clip card shadows */
.owl-carousel .owl-stage {
    display: flex;
    align-items: stretch;
}

.owl-carousel .owl-item {
    display: flex;
    flex-direction: column;
}

.owl-carousel .owl-item>.item {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    padding: 8px 5px 14px;
}

.owl-carousel .owl-item .products,
.owl-carousel .owl-item .product-card-custom {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
}

/* Grid columns equal height */
.product-grid-col {
    display: flex;
    align-items: stretch;
    margin-bottom: 18px;
}

.product-card-custom {
    background: #ffffff;
    border: 1px solid #eceef2;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.product-card-custom:hover {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
    transform: translateY(-3px);
}

.product-card-custom .product-micro,
.product-card-custom .product-micro-row {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    margin: 0 !important;
}

.product-card-custom .product-micro-row>.col-12 {
    padding: 0 !important;
}

.product-card-custom .product-micro-row>.col-12:last-child {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    justify-content: space-between;
}

/* Fixed image container so all cards align */
.product-card-custom .product-image {
    position: relative;
    background: #f9fafb;
    height: 185px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow: hidden;
    border-bottom: 1px solid #f1f2f5;
}

.product-card-custom .product-image .image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-custom .product-image .image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.product-card-custom .product-image img {
    max-width: 100% !important;
    max-height: 160px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    transition: transform 0.3s ease;
    padding: 0 !important;
}

.product-card-custom:hover .product-image img {
    transform: scale(1.04);
}

/* Discount badge */
.product-card-custom #discountpart {
    position: absolute;
    top: 8px;
    left: 8px;
    right: auto;
    width: auto;
    height: auto;
    background: none;
    z-index: 2;
}

.product-card-custom #discountparttwo {
    background: #e63946;
    color: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    display: inline-block;
    width: auto;
    height: auto;
    box-shadow: 0 2px 6px rgba(230, 57, 70, 0.3);
}

.product-card-custom #pdis {
    margin: 0;
    padding: 0;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

/* Card info section */
.product-card-custom .infofe {
    padding: 12px 12px 10px !important;
    border: none !important;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card-custom .product-info {
    padding: 0 !important;
    margin-bottom: 8px;
}

/* Product name: strictly max 2 lines, fixed height for uniform cards */
.product-card-custom h2.name,
.product-card-custom .name {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    height: calc(13.5px * 1.4 * 2) !important;
    margin: 0 !important;
    color: #1a1a1a !important;
}

.product-card-custom h2.name a,
.product-card-custom .name a {
    color: #1a1a1a !important;
    text-decoration: none !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

.product-card-custom h2.name a:hover,
.product-card-custom .name a:hover {
    color: #e63946 !important;
}

/* Price box */
.product-card-custom .price-box {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}

.product-card-custom .old-product-price {
    font-size: 12px;
    color: #8c929c;
    text-decoration: line-through;
}

.product-card-custom .product-price {
    font-size: 15px;
    font-weight: 700;
    color: #111111;
}

.product-card-custom .card-discount-pill {
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Order button pinned to bottom with left/right/bottom padding */
.product-card-custom form,
.product-card-custom .product-card-action {
    width: 100% !important;
    float: none !important;
    margin: 0;
    padding: 0 12px 12px !important;
    box-sizing: border-box;
}

.product-card-custom #purcheseBtn {
    width: 100%;
    border: none !important;
    border-radius: 999px !important;
    background: #E11D24 !important;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(225, 29, 36, 0.25);
    transition: background 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.product-card-custom #purcheseBtn:hover {
    background: #c5161d !important;
    transform: translateY(-1px);
}

.product-card-custom #purcheseBtn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .product-card-custom .product-image {
        height: 150px;
        padding: 8px;
    }

    .product-card-custom .product-image img {
        max-height: 132px !important;
    }

    .product-card-custom .infofe {
        padding: 10px 8px 8px !important;
    }

    .product-card-custom h2.name,
    .product-card-custom .name,
    .product-card-custom h2.name a,
    .product-card-custom .name a {
        font-size: 12.5px !important;
    }

    .product-card-custom h2.name,
    .product-card-custom .name {
        height: calc(12.5px * 1.4 * 2) !important;
    }

    .product-card-custom .product-price {
        font-size: 14px;
    }
}


/* ===== PRODUCT DETAILS: NAME, PRICE, DISCOUNT, QUANTITY ===== */
.pd-title {
    font-size: 26px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    line-height: 1.3 !important;
    margin: 10px 0 12px !important;
    padding: 0 !important;
    border: none !important;
}

.pd-price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.pd-sale-price {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.pd-divider {
    width: 1px;
    height: 18px;
    background: #e5e7eb;
    display: inline-block;
}

.pd-discount-badge {
    background: #dcfce7;
    color: #15803d;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
}

.pd-regular-price {
    font-size: 15px;
    color: #9ca3af;
    text-decoration: line-through;
    line-height: 1;
}

.pd-qty-section {
    margin-bottom: 16px;
}

.pd-qty-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.pd-qty-pill {
    display: inline-flex;
    align-items: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}

.pd-qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
    color: #111827;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    padding: 0;
    line-height: 1;
}

.pd-qty-btn:hover {
    background: #f9fafb;
    color: #000;
}

.pd-qty-btn:active {
    transform: scale(0.95);
}

.pd-qty-input {
    width: 46px !important;
    text-align: center;
    border: none !important;
    background: transparent !important;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    outline: none !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
}

.pd-qty-input::-webkit-outer-spin-button,
.pd-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 767px) {
    .pd-title {
        font-size: 19px !important;
        margin: 8px 0 10px !important;
    }

    .pd-price-row {
        gap: 8px;
        margin-bottom: 12px;
    }

    .pd-sale-price {
        font-size: 20px;
    }

    .pd-discount-badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .pd-regular-price {
        font-size: 13.5px;
    }

    .pd-qty-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .pd-qty-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .pd-qty-input {
        width: 38px;
        font-size: 14px;
    }
}

/* Color & Size active state */
.colortext,
.sizetext {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    transition: background 0.15s ease, color 0.15s ease;
}

.colortext.active,
.sizetext.active {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

/* ===== PRODUCT DETAILS ACTION BUTTONS ===== */
.pd-actions-wrap {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #dfd6d6;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pd-action-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.pd-action-row form {
    flex: 1 1 0;
    margin: 0;
}

.pd-btn-cart,
.pd-btn-order,
.pd-btn-whatsapp,
.pd-btn-call {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    height: 48px;
    padding: 0 16px;
    border-radius: 8px;
    border: none;
    color: #ffffff !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    box-sizing: border-box;
}

.pd-btn-cart:hover,
.pd-btn-order:hover,
.pd-btn-whatsapp:hover,
.pd-btn-call:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    color: #ffffff !important;
}

.pd-btn-cart {
    background: #F27336;
}

.pd-btn-order {
    background: #E11D24;
}

.pd-btn-whatsapp {
    background: #25D366;
}

.pd-btn-call {
    background: #000000;
}

@media (max-width: 767px) {

    .pd-btn-cart,
    .pd-btn-order,
    .pd-btn-whatsapp,
    .pd-btn-call {
        font-size: 14px;
        height: 42px;
        padding: 0 12px;
    }

    .product-card-custom form {
        padding: 0 8px 10px !important;
    }

    .product-card-custom .product-card-action {
        padding: 0 8px 10px !important;
    }

    .product-card-custom #purcheseBtn {
        font-size: 12px;
        padding: 7px 10px;
    }

    .product-card-custom .card-discount-pill {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* Ensure Font Awesome 6 icons are never overridden by global * { font-family } */
.fa,
.fas,
.fa-solid {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.far,
.fa-regular {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

.fab,
.fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* Sidebar category icons */
.level1-styles li a img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    margin-right: 6px;
    vertical-align: middle;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-radius: 5px;
}