/* Phone layout for the product page, the cart page and the mini-cart drawer. Loaded for screens up to 767px only,
   after product.css / cart.css, so desktop is untouched. Tab bar (64px) lives in mobile-app.css. */

/* sticky buy bar + checkout bar are phone-only */
.pdp-sticky, .cc-sticky-checkout, .pdp-dots { display: none; }

@media (max-width: 767px) {
    /* the rupee sign was smaller than the numbers next to it */
    .woocommerce-Price-currencySymbol { font-size: inherit !important; }

    /* ============================== PRODUCT PAGE ============================== */
    /* breadcrumb: one scrolling line with real touch targets */
    body.single-product .pdp-breadcrumb { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; margin: 0 !important; padding: 0 14px !important; overflow-x: auto; white-space: nowrap; font-size: 14px; scrollbar-width: none; }
    body.single-product .pdp-breadcrumb::-webkit-scrollbar { display: none; }
    body.single-product .pdp-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: 14px; }

    /* photos: one full-width slide at a time, snap, dots under */
    body.single-product .pdp-gallery { gap: 0; align-items: flex-start; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
    body.single-product .pdp-photo { flex: 0 0 100%; scroll-snap-stop: always; cursor: default; }
    body.single-product .pdp-photo img { width: 100%; height: auto; }
    .pdp-dots { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 12px 0 0; }
    .pdp-dots i { display: block; width: 7px; height: 7px; border-radius: 4px; background: #cfcfd4; transition: width .2s ease, background-color .2s ease; }
    .pdp-dots i.is-on { width: 20px; background: var(--ink, #0f0f10); }

    /* title, price and the payment-plan lines: readable */
    body.single-product div.product .summary { padding: 14px 14px 24px; }
    body.single-product .pdp-brand { font-size: 14px; }
    body.single-product .product_title { font-size: 22px; line-height: 1.2; margin-bottom: 10px; }
    body.single-product p.price { font-size: 22px; margin-bottom: 8px; }
    body.single-product .product-price-installments-not-in-variation-single, html body.single-product .summary div[style*="font-size: 13px"], html body.single-product .summary > div[style*="font-size: 13px"] { font-size: 14px !important; line-height: 1.5 !important; }
    body.single-product .pdp-recent, body.single-product .pdp-tag { font-size: 14px; }

    /* size chips: big, even, obvious when sold out */
    body.single-product table.variations th.label { margin-bottom: 8px; }
    body.single-product table.variations label { font-size: 14px; }
    body.single-product .pdp-sizeguide { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: 14px; }
    body.single-product .cfvsw-swatches-container { gap: 10px; }
    body.single-product .cfvsw-swatches-option.cfvsw-label-option { min-width: 58px !important; min-height: 48px !important; font-size: 15px; }
    body.single-product .cfvsw-swatches-option .cfvsw-swatch-inner { font-size: 15px; }
    body.single-product .cfvsw-swatches-option.cfvsw-swatches-disabled { opacity: .5; color: #6b6b6b; }
    body.single-product .woocommerce-variation { font-size: 14px; }

    /* quantity + add to cart */
    body.single-product .woocommerce-variation-add-to-cart { gap: 10px; }
    body.single-product .woocommerce-variation-add-to-cart .quantity { flex: none !important; border-color: #d6d6d6; }
    html body.single-product .quantity .minus, html body.single-product .quantity .plus, html body.single-product .quantity .ast-qty-placeholder { flex: none; display: grid; place-items: center; width: 44px !important; min-width: 44px; min-height: 52px; border: 0 !important; font-size: 22px; }
    html body.single-product .quantity input.qty { width: 44px !important; }
    body.single-product .quantity input.qty { width: 44px; font-size: 16px; }
    body.single-product .single_add_to_cart_button.button { min-width: 0; height: 54px; padding: 0 8px !important; font-size: 14px !important; letter-spacing: .06em; white-space: nowrap; }

    /* accordions */
    .pdp-accordion summary { min-height: 52px; padding: 12px 0; font-size: 14px; }
    .pdp-acc-body { font-size: 15px; line-height: 1.65; overflow-x: auto; }
    .pdp-acc-body table { display: block; max-width: 100%; overflow-x: auto; font-size: 14px; }
    .pdp-acc-body th, .pdp-acc-body td { font-size: 14px; padding: 8px 10px; white-space: nowrap; }
    .pdp-acc-body h4, .pdp-acc-body h3 { font-size: 14px; }
    .pdp-acc-body img { max-width: 100%; height: auto; }
    body.single-product .pdp-breadcrumb a { min-width: 44px; justify-content: center; }
    /* the little payment-plan info icons are links: give them a real hit area without changing how they look */
    body.single-product .summary a[href*="mintpay.lk/education"], body.single-product .summary a[href*="customer-education"] { position: relative; }
    body.single-product .summary a[href*="mintpay.lk/education"]::after, body.single-product .summary a[href*="customer-education"]::after { content: ""; position: absolute; inset: -16px -12px; }
    .pdp-acc-body a { display: inline-block; padding: 10px 0; }
    .pdp-acc-body p { margin: 0 0 6px; }
    .pdp-chart { font-size: 14px; }
    .pdp-chart th, .pdp-chart td { padding: 10px 6px; }
    .pdp-chart-wrap { -webkit-overflow-scrolling: touch; }
    .pdp-chart thead th { font-size: 14px; }
    .pdp-chart-note { font-size: 14px; }
    body.single-product section.related { margin-top: 26px; padding: 0 6px; }
    body.single-product section.related > h2 { font-size: 20px; }

    /* sticky buy bar (built by product-mobile.js), sits on top of the tab bar */
    .pdp-sticky { display: flex; position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 290; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border-top: 1px solid #e3e3e3; box-shadow: 0 -6px 20px rgba(15, 15, 16, .07); transform: translateY(140%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
    .pdp-sticky.is-visible { transform: none; visibility: visible; transition-delay: 0s; }
    .pdp-sticky .ps-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
    .pdp-sticky .ps-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
    .pdp-sticky .ps-price { font-size: 15px; font-weight: 700; }
    .pdp-sticky .ps-price del { color: #8a8a93; font-weight: 400; margin-right: 6px; }
    .pdp-sticky .ps-price ins { text-decoration: none; color: var(--blue, #0050c8); }
    .pdp-sticky button { flex: none; min-width: 148px; height: 50px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--ink, #0f0f10); color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
    .pdp-sticky button:disabled { background: #b8b8c0; }
    body.has-pdp-sticky { padding-bottom: calc(64px + 72px + env(safe-area-inset-bottom)); }
    .pdp-shake { animation: pdp-shake .45s ease; }
    @keyframes pdp-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

    /* ================================ CART PAGE =============================== */
    .woocommerce:has(> .woocommerce-cart-form) { display: block; padding: 0 14px 8px; }
    .woocommerce:has(> .woocommerce-cart-form) .cc-title { margin: 18px 0 4px; font-size: 22px; }

    html body .woocommerce-cart-form table.cart, html body .woocommerce-cart-form table.cart tbody { display: block; width: 100%; }
    html body .woocommerce-cart-form table.cart tr.cart_item { display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-areas: "thumb name" "thumb sub" "thumb qty"; grid-template-rows: auto auto 1fr; column-gap: 14px; row-gap: 6px; align-items: start; padding: 16px 0; position: relative; border-bottom: 1px solid var(--cc-line, #ececec); }
    html body .woocommerce-cart-form table.cart tr.cart_item td { min-width: 0; padding: 0 !important; text-align: left !important; display: block !important; }
    html body .woocommerce-cart-form td.product-thumbnail { grid-area: thumb; width: auto; } /* (a "grid-row: auto" here cancelled the 3-row span and pushed price and quantity below the photo) */
    html body .woocommerce-cart-form td.product-thumbnail img { width: 84px; }
    html body .woocommerce-cart-form td.product-name { grid-area: name; padding-right: 40px; }
    html body .woocommerce-cart-form td.product-name a { display: block; padding-top: 2px; font-size: 13px; font-weight: 700; letter-spacing: .02em; line-height: 1.3; overflow-wrap: anywhere; }
    html body .woocommerce-cart-form .cc-size { display: block; font-size: 12px; color: #6b6b73; margin-top: 3px; }
    html body .woocommerce-cart-form td.product-quantity { grid-area: qty; align-self: end; }
    html body .woocommerce-cart-form table.cart tr.cart_item td.product-subtotal { grid-area: sub; align-self: start; justify-self: start; font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; text-align: left !important; }
    html body .woocommerce-cart-form table.cart tr.cart_item td.product-subtotal * { margin: 0 !important; line-height: 1.3; }
    html body .woocommerce-cart-form table.cart tr.cart_item td.product-price { display: none !important; }
    html body .woocommerce-cart-form table.cart tr.cart_item td.product-remove { position: absolute; top: 4px; right: -12px; width: 44px; height: 44px; display: grid !important; place-items: center; text-align: center !important; }
    html body .woocommerce-cart-form td.product-remove a.remove { display: grid; place-items: center; width: 44px; height: 44px; font-size: 22px; line-height: 1; border-radius: 50%; color: #8b8b93 !important; background: transparent !important; }
    html body .woocommerce-cart-form table.cart td.product-quantity .quantity { border-radius: 10px; }
    html body .woocommerce-cart-form table.cart td.product-quantity .quantity .minus, html body .woocommerce-cart-form table.cart td.product-quantity .quantity .plus { width: 44px; min-height: 44px; display: grid; place-items: center; font-size: 20px; }
    html body .woocommerce-cart-form table.cart td.product-quantity .quantity input.qty { width: 44px; min-height: 44px; font-size: 16px; }
    html body .woocommerce-cart-form td.actions { display: flex; padding: 8px 0 0 !important; }
    html body .woocommerce-cart-form td.actions .cc-continue { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
    html body .woocommerce-cart-form .cc-saving { font-size: 14px; }

    /* summary: plain card; the fixed checkout bar below carries the main button */
    .cart-collaterals { position: static; margin: 6px 0 0; padding-bottom: 84px; }
    .cart-collaterals .cart_totals { border-radius: 12px; padding: 16px; box-shadow: none; }
    .cart-collaterals .cart_totals h2 { font-size: 18px; }
    .cart-collaterals table th, .cart-collaterals table td { font-size: 15px; }
    .cart-collaterals .cc-muted { font-size: 14px; }
    .wc-proceed-to-checkout { display: none; }
    .cc-perks { font-size: 14px; }
    .cc-sticky-checkout { display: flex; position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 290; align-items: center; gap: 14px; padding: 10px 14px; background: #fff; border-top: 1px solid #e3e3e3; box-shadow: 0 -6px 20px rgba(15, 15, 16, .07); }
    .cc-sticky-checkout .cc-total { display: flex; flex-direction: column; line-height: 1.2; }
    .cc-sticky-checkout .cc-total span { font-size: 14px; color: #6b6b6b; }
    .cc-sticky-checkout .cc-total strong { font-size: 18px; }
    .cc-sticky-checkout a.button { flex: 1; display: grid; place-items: center; height: 50px; padding: 0 16px !important; border-radius: 10px !important; background: var(--ink, #0f0f10); color: #fff; font-size: 15px !important; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }

    /* empty cart */
    .wc-empty-cart-message { padding-top: 20px; }
    .woocommerce-info.cart-empty { font-size: 18px; padding: 24px 0 8px; }
    .return-to-shop { margin: 8px 0 24px; }
    .return-to-shop .button { display: inline-grid; place-items: center; min-height: 50px; padding: 0 28px !important; border-radius: 10px !important; font-size: 15px !important; }

    /* ============================= MINI-CART DRAWER ============================ */
    .astra-cart-drawer .astra-cart-drawer-content { padding-bottom: env(safe-area-inset-bottom); }
    .astra-cart-drawer .mc-name { font-size: 14px; }
    .astra-cart-drawer .mc-size, .astra-cart-drawer .mini_cart_item .quantity { font-size: 14px; }
    .astra-cart-drawer .mc-line { font-size: 14px; }
    .astra-cart-drawer a.remove.remove_from_cart_button { width: 44px !important; height: 44px !important; margin: -6px -10px 0 0; }
    .astra-cart-drawer .woocommerce-mini-cart__total { font-size: 16px; }
    .astra-cart-drawer .woocommerce-mini-cart__buttons { padding-bottom: calc(22px + env(safe-area-inset-bottom)) !important; }
    .astra-cart-drawer .woocommerce-mini-cart__buttons .button, .astra-cart-drawer .ast-continue-shopping { min-height: 50px; display: grid; place-items: center; font-size: 15px !important; }
    .astra-cart-drawer .mc-viewcart { display: grid; place-items: center; min-height: 44px; font-size: 15px; }
    .astra-cart-drawer .astra-cart-drawer-close { width: 44px; height: 44px; display: grid; place-items: center; }
}
