/**
 * Product Details — Consolidated Responsive Stylesheet
 * Mobile-first (min-width) single breakpoint ladder.
 * Alignment (pages ↔ button ↔ price, space-between, nowrap) is IDENTICAL
 * at every tier — only font-size / padding / gap / heights scale up.
 *
 * Tiers:
 *  Base        : 0      – 359px   (very small phones, Galaxy Z Flip closed)
 *  XS          : 360    – 479px   (standard small mobile portrait)
 *  SM          : 480    – 653px   (larger mobile / mini-iPhone-like)
 *  MD          : 654    – 767px   (foldables open / phablets)
 *  TAB-P       : 768    – 1023px  (iPad / Android tablet portrait)
 *  TAB-L       : 1024   – 1199px  (iPad Pro landscape / small laptop)
 *  DESK        : 1200   – 1599px  (desktop / laptop)
 *  DESK-XL     : 1600px+          (large desktop)
 *  + one orientation:landscape safety net for short-height mobile landscape
 */

/* ==========================================================
   BASE — mobile-first defaults (0px and up)
   ========================================================== */

.product__wraper .products-links {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: auto;
}

.product__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px;
}

.product__content--title {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product__content h3 {
    font-size: 18px;
    min-height: auto;
}

.product__description {
    font-size: 13px;
    line-height: 1.4;
    min-height: auto;
    max-height: none;
    -webkit-line-clamp: 4;
}

.product__image-box {
    height: 250px;
}

/* --- The details bar: layout locked here, reused at every tier --- */
.product__details {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    margin-top: auto !important;
    box-sizing: border-box !important;
    gap: 4px !important;
    padding: 0 10px 14px !important;
}

.product__details--pages,
.product__details--price {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-family: "Sora", sans-serif !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    font-size: 11px !important;
}

.product__details--pages { color: #F0666F !important; }
.product__details--price { color: #657BBC !important; }

.product__details .button-secondary {
    flex: 0 1 auto !important;      /* hugs its text — no longer stretches to fill the row */
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #F1F1F1 !important;
    font-family: "Sora", sans-serif !important;
    font-weight: 500 !important;
    background: #F0666F !important;
    border: 1px solid #F0666F !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all .3s ease !important;
    font-size: 10px !important;
    line-height: 14px !important;
    padding: 6px 10px !important;   /* small breathing room around the text */
}

.product__details .button-secondary:hover {
    background: #e45861 !important;
    border-color: #e45861 !important;
}

/* Grid: full-width single column by default (smallest phones) */
.views-rows,
.col-md-6.col-xs-12.views-rows {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}


/* ==========================================================
   XS — 360px and up (standard small mobile portrait)
   ========================================================== */
@media (min-width: 360px) {

    .product__image-box { height: 250px; }

    .product__details { gap: 6px !important; padding: 0 12px 16px !important; }

    .product__details--pages,
    .product__details--price { font-size: 12px !important; }

    .product__details .button-secondary {
        font-size: 11px !important;
        padding: 7px 10px !important;
    }
}


/* ==========================================================
   SM — 480px and up (larger mobile / mini-iPhone-like)
   ========================================================== */
@media (min-width: 480px) {

    .product__image-box { height: 240px; }

    .product__content h3 { font-size: 20px; }
    .product__description { font-size: 14px; }

    .product__details { gap: 8px !important; padding: 0 16px 18px !important; }

    .product__details--pages,
    .product__details--price { font-size: 13px !important; }

    .product__details .button-secondary {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
}


/* ==========================================================
   MD — 654px and up (foldables open / phablets)
   Grid moves to 2 columns from here up.
   ========================================================== */
@media (min-width: 654px) {

    .views-rows,
    .col-md-6.col-xs-12.views-rows {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .products-links { min-height: 560px; }
    .product__image-box { height: 250px; }
    .product__content h3 { font-size: 22px; }

    .product__details { gap: 8px !important; padding: 0 16px 18px !important; }

    .product__details--pages,
    .product__details--price { font-size: 14px !important; }

    .product__details .button-secondary {
        font-size: 13px !important;
        padding: 8px 14px !important;
    }
}


/* ==========================================================
   TAB-P — 768px and up (iPad / Android tablet portrait)
   ========================================================== */
@media (min-width: 768px) {

    .products-links { min-height: 610px; }
    .product__image-box { height: 280px; }
    .product__content { padding: 16px; }

    .product__content h3 {
        min-height: 60px;
        font-size: 24px;
    }

    .product__description {
        min-height: 72px;
        font-size: 16px;
        line-height: 24px;
        -webkit-line-clamp: 3;
    }

    .product__details { gap: 10px !important; padding: 0 16px 16px !important; }

    .product__details--pages,
    .product__details--price { font-size: 15px !important; }

    .product__details .button-secondary {
        font-size: 14px !important;
        padding: 10px 14px !important;
    }
}


/* ==========================================================
   TAB-L — 1024px and up (iPad Pro landscape / small laptop)
   ========================================================== */
@media (min-width: 1024px) {

    .products-links { min-height: 640px; }
    .product__image-box { height: 260px; }
    .product__content { padding: 18px; }

    .product__details { gap: 10px !important; padding: 0 20px 18px !important; }

    .product__details--pages,
    .product__details--price { font-size: 16px !important; }

    .product__details .button-secondary {
        font-size: 15px !important;
        padding: 10px 18px !important;
    }
}


/* ==========================================================
   DESK — 1200px and up (desktop / laptop)
   ========================================================== */
@media (min-width: 1200px) {

    .products-links { min-height: 680px; }
    .product__image-box { height: 480px; }

    .product__details { gap: 16px !important; padding: 0 24px 24px !important; }

    .product__details--pages,
    .product__details--price { font-size: 22px !important; }

    .product__details .button-secondary {
        font-size: 20px !important;
        padding: 14px 24px !important;
    }
}


/* ==========================================================
   DESK-XL — 1600px and up (large desktop)
   ========================================================== */
@media (min-width: 1600px) {

    .products-links { min-height: 720px; }
    .product__image-box { height: 500px; }

    .product__description {
        -webkit-line-clamp: 3;
        min-height: 78px;
    }

    .product__details { gap: 18px !important; padding: 0 26px 26px !important; }

    .product__details--pages,
    .product__details--price { font-size: 24px !important; }

    .product__details .button-secondary {
        font-size: 22px !important;
        padding: 16px 26px !important;
    }
}


/* ==========================================================
   LANDSCAPE SAFETY NET — short-height mobile landscape
   (e.g. phone rotated: wide width but very limited vertical space)
   Only trims vertical-heavy properties; alignment/order untouched.
   ========================================================== */
@media (orientation: landscape) and (max-height: 480px) {

    .product__image-box { height: 240px; }
    .product__content { padding: 10px; }
    .product__description { -webkit-line-clamp: 2; }

    .product__details { padding-bottom: 10px !important; }
}


/* ==========================================================
   EQUAL CARD / GRID FIX
   ADD THIS AT THE END ONLY
   ========================================================== */

.views-view-grid{
    width:100% !important;
}

.views-view-grid .row,
.views-view-grid .views-row{

    display:flex !important;
    flex-wrap:wrap !important;
    align-items:stretch !important;

    width:100% !important;

    margin-left:0 !important;
    margin-right:0 !important;

}

.views-view-grid .views-rows,
.views-view-grid .col-md-6.col-xs-12.views-rows{

    display:flex !important;
    flex-direction:column !important;

    box-sizing:border-box !important;

    width:100% !important;
    height:100% !important;

}

.views-view-grid .views-field,
.views-view-grid .views-field-nothing,
.views-view-grid .field-content{

    display:flex !important;
    flex-direction:column !important;

    width:100% !important;
    height:100% !important;

    flex:1 !important;

}

.product__wraper{

    display:flex !important;
    flex-direction:column !important;

    width:100% !important;
    height:100% !important;

}

.product__wraper .products-links{

    display:flex !important;
    flex-direction:column !important;

    width:100% !important;
    height:100% !important;

    box-sizing:border-box !important;

}

.product__content{

    flex:1 1 auto !important;

}

.product__content--title{

    flex:1 1 auto !important;

}

.product__details{

    margin-top:auto !important;

}