/* ==========================================================================
   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: #003135; }

.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, #003135, #0a5157);
    color: #fff; font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 49, 53, .25);
}
.btn-order:hover {
    background: linear-gradient(135deg, #001e21, #003135);
    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: #003135; }
.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: #003135; 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; }


/* ==========================================================================
   Print product card (products.type = 2): photo, admin badge, category, name,
   "From / Min qty" strip. Follows the reference shop's card.
   ========================================================================== */
.product-card.print-card {
    justify-content: flex-start; padding: 12px; gap: 0;
    border: 1px solid #e5e5e5; border-radius: 8px; box-shadow: none;
}
.product-card.print-card:hover { transform: none; box-shadow: 0 4px 12px rgba(15, 23, 42, .1); }

.print-card .pc-image {
    position: relative; display: block; width: 100%; aspect-ratio: 1 / 1;
    border-radius: 4px; overflow: hidden; background: #f2f4f7;
}
.print-card .pc-image img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .4s ease; }
.print-card:hover .pc-image img { transform: scale(1.04); }
.print-card .pc-badge {
    position: absolute; top: 6px; left: 6px; z-index: 2; max-width: calc(100% - 12px);
    padding: 4px 8px; border-radius: 4px; color: #fff; font-size: 12px; line-height: 16px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.print-card .pc-body { margin-top: 8px; padding: 10px 0; text-align: left; }
.print-card .pc-chip { display: none; }
.print-card .pc-cat { margin: 0; font-size: 12px; line-height: 16px; color: #003135; }
.print-card .pc-title {
    display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px;
    font-size: 14px; font-weight: 700; line-height: 20px; color: #262626; text-decoration: none;
}
.print-card .pc-title span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.print-card .pc-title i { flex: 0 0 auto; font-size: 13px; color: #003135; }
.print-card .pc-title:hover span { text-decoration: underline; }

.print-card .pc-foot {
    margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 32px; padding: 2px 8px; border-radius: 6px; background: #f8fafc;
    font-size: 12px; font-weight: 500; color: #64748b;
}
.print-card .pc-foot b { font-weight: 600; color: #344054; white-space: nowrap; }
.print-card .pc-foot span { white-space: nowrap; }
.print-card .pc-dot { width: 4px; height: 4px; border-radius: 50%; background: #64748b; flex: 0 0 auto; }

/* Phone: two cards a row leave ~140px for the strip, too little for both facts on one line, so each fact gets its
   own row: the label on the left, the value on the right, a hairline between the two rows. */
@media (max-width: 767.98px) {
    .print-card .pc-foot { flex-direction: column; align-items: stretch; justify-content: center; gap: 0; padding: 2px 10px; font-size: 12px; line-height: 1.3; }
    .print-card .pc-foot > span { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; }
    .print-card .pc-dot { display: none; }
    .print-card .pc-dot + span { border-top: 1px solid #e3e8ef; }
    .print-card .pc-body { padding: 8px 0 8px; }
    .print-card .pc-title { font-size: 13px; margin-top: 0; }
    /* the category is a small chip between the name and the price, not a sub-title line above the name */
    .print-card .pc-cat { display: none; }
    .print-card .pc-chip {
        display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin-top: 6px; padding: 3px 10px 3px 8px;
        border-radius: 999px; background: #eaf3f3; color: #003135; font-size: 11px; font-weight: 600; line-height: 16px;
    }
    .print-card .pc-chip i, .print-card .pc-chip svg { flex: 0 0 auto; width: 9px; height: 9px; font-size: 9px; color: #0f766e; }
    .print-card .pc-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
