/* ==========================================================================
   Product card
   --------------------------------------------------------------------------
   Built to the supplied design. Loaded after style.css and responsive.css so
   it replaces the older .pro_* card rules those files still carry for other
   templates.

   The card is a flex column with space-between, so the button row sits on the
   floor of the card whatever the length of the product name -- a row of cards
   lines up even when one title wraps to two lines and its neighbour does not.
   ========================================================================== */

/* The reference sets box-sizing globally; this theme does not, so the
   card sets it for its own parts -- otherwise the 1.5px border on the
   cart button pushed it past the 38px square it is meant to be. */
.product-card, .product-card *, .product-card *::before, .product-card *::after {
    box-sizing: border-box;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, .8);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    transition: transform .3s ease, box-shadow .3s ease;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .12);
}

/* -- discount badge ------------------------------------------------------- */
.discount-badge {
    position: absolute; top: 10px; right: 10px; z-index: 10;
    padding: 4px 8px; border-radius: 20px;
    background: linear-gradient(135deg, #ff4e50, #f9d423);
    color: #fff; font-size: 11px; font-weight: 800; line-height: 1.4;
    box-shadow: 0 2px 8px rgba(255, 78, 80, .3);
}

/* -- image ---------------------------------------------------------------- */
.image-container {
    display: block; width: 100%; height: 160px;
    overflow: hidden; background: #f8fafc;
}
.image-container img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .5s ease;
}
.product-card:hover .image-container img { transform: scale(1.08); }

/* -- name and price ------------------------------------------------------- */
.card-content { padding: 12px 12px 8px; text-align: center; }

.product-title {
    margin: 0 0 8px; height: 38px; overflow: hidden;
    font-size: 15px; font-weight: 700; line-height: 1.3; color: #0f172a;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.product-title a { color: inherit; text-decoration: none; }
.product-title a:hover { color: #ff5722; }

.price-container {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; width: 100%;
    margin-bottom: 10px; padding: 6px 10px; border-radius: 8px;
    background: #fff5f5;
}
.old-price { font-size: 13px; font-weight: 600; color: #94a3b8; text-decoration: line-through; }
.new-price { font-size: 18px; font-weight: 800; color: #e11d48; }

/* -- buttons -------------------------------------------------------------- */
.button-group-inline {
    display: flex; align-items: center; gap: 6px;
    padding: 0 12px 12px;
}
/* Each button is posted by its own form, so the forms carry the sizing that
   the buttons would otherwise have had. */
.button-group-inline > form { display: flex; margin: 0; min-width: 0; }
.button-group-inline > form:first-child { flex: 1; }
.button-group-inline > form:last-child  { flex: 0 0 auto; }
.button-group-inline > form > .btn { width: 100%; }

.button-group-inline .btn {
    display: flex; align-items: center; justify-content: center;
    height: 38px; border: none; border-radius: 8px;
    font-weight: 700; cursor: pointer; text-decoration: none;
    transition: all .2s ease;
}

.btn-order {
    flex: 1;
    background: linear-gradient(135deg, #ff5722, #ff7043);
    color: #fff; font-size: 13px;
    box-shadow: 0 4px 12px rgba(255, 87, 34, .25);
}
.btn-order:hover {
    background: linear-gradient(135deg, #f4511e, #ff5722);
    color: #fff;
}

.btn-cart {
    flex-shrink: 0; width: 38px;
    background-color: #fff; color: #334155;
    border: 1.5px solid #e2e8f0;
}
.btn-cart:hover { background-color: #f8fafc; border-color: #cbd5e1; color: #ff5722; }
.btn-cart svg { width: 16px; height: 16px; fill: currentColor; }

/* -- phones --------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .product-card { border-radius: 13px; }
    .image-container { height: 132px; }
    .card-content { padding: 10px 10px 6px; }
    .product-title { font-size: 13.5px; height: 35px; }
    .price-container { gap: 6px; padding: 5px 8px; margin-bottom: 8px; }
    .old-price { font-size: 11.5px; }
    .new-price { font-size: 15.5px; }
    .button-group-inline { padding: 0 10px 10px; gap: 5px; }
    .button-group-inline .btn { height: 34px; }
    .btn-order { font-size: 12px; }
    .btn-cart { width: 34px; }
}

/* ==========================================================================
   Side cart drawer -- quantity stepper
   --------------------------------------------------------------------------
   The drawer rows gained a stepper when the delete button was fixed; these
   are its only new styles. Everything else in the drawer stays in style.css.
   ========================================================================== */
.side-cart-qty {
    display: inline-flex; align-items: center;
    border: 1px solid #e2e8f0; border-radius: 7px; overflow: hidden;
    background: #f8fafc;
}
.side-cart-qty button {
    width: 24px; height: 24px; padding: 0; border: 0; cursor: pointer;
    background: none; color: #334155;
    font-size: 14px; font-weight: 700; line-height: 1;
}
.side-cart-qty button:hover:not(:disabled) { background: #ff5722; color: #fff; }
.side-cart-qty button:disabled { opacity: .5; cursor: default; }
.side-cart-qty > span {
    min-width: 26px; text-align: center;
    font-size: 12.5px; font-weight: 700; color: #0f172a;
}
.side-cart-remove:disabled { opacity: .5; cursor: default; }
