:root {
    /* Cards Section */
    --ebcard1-title-color: #4B362D;
    --ebcard1-card-border: #A8894F;
    --ebcard1-slider-wrapper-border: #A8894F;
    --ebcard1-slider-wrapper-radius: 14px;
    --ebcard1-slider-wrapper-bg: #ffffff;
    --ebcard1-card-bg: #ffffff;
    --ebcard1-name-color: #1a2b40;
    --ebcard1-price-color: #A8894F;
    --ebcard1-best-color: #A8894F;
    --ebcard1-old-price-color: #9ca3af;
    --ebcard1-desc-color: #4B362D;
    --ebcard1-add-bg: #A8894F;
    --ebcard1-add-text: #ffffff;
    --ebcard1-img-border: #ffffff;
    --ebcard1-img-shadow: rgba(0, 0, 0, 0.15);

    /* --- WIDTHS/SIZES --- */
    --ebcard1-img-size: clamp(100px, 25vw, 140px);
    --ebcard1-card-max-width: 800px;

    /* --- FONT SIZES --- */
    --ebmenu1stbar-fs-item: clamp(0.8rem, 2.5vw, 0.95rem);
    --ebcard1-fs-title: clamp(1.2rem, 4vw, 1.5rem);
    --ebcard1-fs-name: clamp(1rem, 3vw, 1.15rem);
    --ebcard1-fs-price: clamp(1.2rem, 4vw, 1.5rem);
    --ebcard1-fs-desc: clamp(0.7rem, 2.4vw, 0.8rem);

    /* QUANTITY CONTROLS --- */
    --ebcard1-qty-border-color: #000000;
    --ebcard1-qty-text-color: #000000;
    --ebcard1-qty-bg: #ffffff;

    /* Variable Widths & Heights */
    --ebcard1-action-width: var(--ebcard1-img-size);
    /* Matches image width */
    --ebcard1-qty-height: 35px;
    --ebcard1-border-width: 1.5px;
}

/* =========================================
   CARDS SECTION (Section 5)
   ========================================= */
.ebcard1-section {
    display: flex;
    flex-direction: column;
    width: calc(100vw - 2em);
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 0px;
    gap: 25px;
}

.ebcard1-category-block {
    display: flex;
    flex-direction: column;
    gap: 15px;

}

.ebcard1-title-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.ebcard1-title {
    color: var(--ebcard1-title-color);
    font-size: var(--ebcard1-fs-title);
    position: relative;
    text-align: center;
    width: fit-content;
    margin: 0% auto;
}

/* Border bottom for title similar to image */
.ebcard1-title::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: var(--ebmenu1stbar-active-bg);
}

.ebcard1-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
}

.ebcard1-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    /* Distance between the title and cards is handled here via flex parent gap */
}

.ebcard1-card {
    display: flex;
    justify-content: space-between;
    background: var(--ebcard1-card-bg);
    gap: 10px;
    direction: rtl;
    width: 100%;
}

.ebcard1-card-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: var(--ebcard1-card-bg);
    border: 1.5px dashed var(--ebcard1-card-border);
    border-radius: 15px;
    padding: 10px;
    gap: 10px;
    direction: rtl;
}

.ebcard1-content-side {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    align-items: flex-start;
    font-weight: 600;
    font-size: var(--ebcard1-fs-price);
}

.ebcard1-description-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ebcard1-crd-desc {

    font-size: var(--ebcard1-fs-desc);

    overflow: hidden;

    display: -webkit-box;

    -webkit-line-clamp: 4;

    -webkit-box-orient: vertical;

    line-height: 1.7;

    transition: all .3s ease;

}

/* expanded */

.ebcard1-crd-desc.expanded {

    display: block;

    overflow: visible;

}

/* button */

.ebcard1-desc-toggle {

    align-self: flex-start;

    border: none;

    background: none;

    cursor: pointer;

    color: #555;

    font-size: 15px;

    display: none;

    transition: .3s;

}

/* .ebcard1-desc-toggle.open {
    transform: rotate(180deg);
} */

.ebcard1-add-btn {
    background: var(--ebcard1-add-bg);
    color: var(--ebcard1-add-text);
    padding: 6px 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9rem;
}

.ebcard1-details-btn {
    background: var(--ebcard1-add-bg);
    color: var(--ebcard1-add-text);
    padding: 6px 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9rem;
}

.ebcard1-media-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    /* Perfect distance between the image and the buttons below it */
    flex: 0 0 var(--ebcard1-img-size);
    /* Prevents shrinking */
}

.ebcard1-img {
    width: var(--ebcard1-img-size);
    /* height: var(--ebcard1-img-size); */
    aspect-ratio: 1/1;
    object-fit: fill;
    border-radius: 12px;
    border: 4px solid var(--ebcard1-img-border);
    box-shadow: 0 4px 12px var(--ebcard1-img-shadow);
}

.ebcard1-action-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;


}

.ebcard1-price-old {
    font-size: clamp(1rem, 2vw, 1.25rem);
    text-decoration: line-through;
    color: var(--ebcard1-old-price-color);
    width: fit-content;
}

.ebcard1-best-seller {

    background-color: var(--ebcard1-card-bg);
    color: var(--ebcard1-best-color);
    padding: 0.2rem 0.7rem;
    border-radius: 10px;
    border: 1px solid var(--ebcard1-best-color);
    font-weight: bold;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    box-shadow: 0px 2px 2px rgba(128, 128, 128, 0.425);
}

/* =========================================
   QUANTITY CONTROLS (The Pill Shape)
   ========================================= */
.ebcard1-qty-controls {
    /* Using Flexbox to perfectly align the -, number, and + */
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* width: var(--ebmenu1stbar-width-full); */
    width: fit-content;
    height: var(--ebcard1-qty-height);
    border: var(--ebcard1-border-width) solid var(--ebcard1-qty-border-color);
    border-radius: 50px;
    background-color: var(--ebcard1-qty-bg);
    overflow: hidden;
    direction: ltr;
}

.ebcard1-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    /* height: var(--ebmenu1stbar-width-full); */
    height: 100%;
    background: transparent;
    border: none;
    color: var(--ebcard1-qty-border-color);
    font-size: var(--ebcard1-fs-title);
    font-weight: bolder;
    cursor: pointer;
    padding-inline: 8px;
}

.ebcard1-qty-value-box {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    padding-inline: 8px;
    border-left: var(--ebcard1-border-width) solid var(--ebcard1-qty-border-color);
    border-right: var(--ebcard1-border-width) solid var(--ebcard1-qty-border-color);
}

.ebcard1-qty-value {
    font-weight: bold;
    color: var(--ebcard1-qty-text-color);
    font-size: var(--ebcard1-fs-price);
}

/* =========================================
   DESKTOP ADAPTATIONS
   ========================================= */
@media (min-width:768px) {
    .ebcard1-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* Two columns on desktop */
        margin: 0 auto;
    }
}