/* Ecommerce conversion styles: header actions, mini-cart, cart page, PDP.
   Intentionally minimal/functional for now — full visual redesign lands in
   a later phase once a reference design is available. Reuses the existing
   theme color variables defined in custom.css (:root). */

/* ---------- Header action bar ---------- */
.hdr_action_bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 24px;
    background: #fff;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}
.hdr_search_form { position: relative; flex: 1 1 320px; max-width: 480px; display: flex; }
.hdr_search_input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
}
.hdr_search_btn {
    border: 1px solid var(--theme_color_3, #D41A20);
    background: var(--theme_color_3, #D41A20);
    color: #fff;
    padding: 0 16px;
    border-radius: 0 4px 4px 0;
}
.hdr_search_suggestions {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1px solid #eee;
    z-index: 50;
    display: none;
    max-height: 360px;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0,0,0,.1);
}
.hdr_search_suggestion_item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; text-decoration: none; color: #333; font-size: 13px; }
.hdr_search_suggestion_item:hover { background: #f7f7f7; }
.hdr_search_suggestion_item img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; }
.hdr_search_no_results { padding: 12px; color: #888; font-size: 13px; }
.hdr_action_icons { display: flex; align-items: center; gap: 20px; }
.hdr_action_icon {
    position: relative;
    color: #222;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.hdr_action_icon:hover { color: var(--theme_color_3, #D41A20); }
.hdr_action_label { font-size: 13px; }
.hdr_action_badge {
    position: absolute;
    top: -8px; right: -10px;
    background: var(--theme_color_3, #D41A20);
    color: #fff;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    padding: 0 3px;
}

/* ---------- Mini cart drawer ---------- */
.mini_cart_overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1040;
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease;
}
.mini_cart_overlay.is-active { opacity: 1; visibility: visible; }
.mini_cart_drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 100%; max-width: 380px;
    background: #fff;
    z-index: 1050;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s ease;
}
.mini_cart_drawer.is-active { transform: translateX(0); }
.mini_cart_header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #eee; }
.mini_cart_close { background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; }
.mini_cart_body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.mini_cart_loading, .mini_cart_empty { text-align: center; color: #888; padding: 40px 0; }
.mini_cart_item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f2f2f2; position: relative; }
.mini_cart_item img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.mini_cart_item_info { flex: 1; }
.mini_cart_item_name { font-size: 14px; font-weight: 600; }
.mini_cart_item_variation { font-size: 12px; color: #888; }
.mini_cart_item_qty_row { display: flex; justify-content: space-between; font-size: 13px; margin-top: 4px; }
.mini_cart_remove_btn { background: none; border: none; color: #999; font-size: 18px; cursor: pointer; align-self: flex-start; }
.mini_cart_footer { padding: 16px 20px; border-top: 1px solid #eee; }
.mini_cart_subtotal { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 12px; }
.mini_cart_view_btn, .mini_cart_checkout_btn { display: block; width: 100%; text-align: center; margin-bottom: 8px; }
body.mini-cart-lock { overflow: hidden; }

/* ---------- Product listing badges ---------- */
.product_box { position: relative; }
.product_badge {
    position: absolute; top: 10px; left: 10px;
    font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 3px;
    color: #fff; z-index: 2;
}
.product_badge_out { background: #888; }
.product_badge_low { background: #E8A33D; }
.product_filter_price_col, .product_filter_sort_col { margin-top: 8px; }

/* ---------- Cart page ---------- */
.cart_page_wrap { padding: 30px 0 60px; }
.cart_page_title { margin-bottom: 24px; }
.cart_table_wrap { overflow-x: auto; }
.cart_table { width: 100%; border-collapse: collapse; }
.cart_table th, .cart_table td { padding: 14px 10px; border-bottom: 1px solid #eee; text-align: left; vertical-align: middle; }
.cart_product_cell { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.cart_product_cell img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.cart_product_name { font-weight: 600; }
.cart_product_variation { font-size: 12px; color: #888; }
.cart_stock_warning { font-size: 12px; color: #c0392b; margin-top: 2px; }
.cart_qty_stepper { display: inline-flex; align-items: center; border: 1px solid #ddd; border-radius: 4px; }
.cart_qty_btn { background: none; border: none; width: 30px; height: 32px; font-size: 16px; cursor: pointer; }
.cart_qty_input { width: 48px; text-align: center; border: none; border-left: 1px solid #ddd; border-right: 1px solid #ddd; height: 32px; }
.cart_remove_btn { background: none; border: none; color: #c0392b; font-size: 16px; cursor: pointer; }
.cart_summary_row { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; margin-top: 30px; }
.cart_coupon_box { flex: 1 1 300px; }
.cart_coupon_input_row { display: flex; gap: 8px; margin-top: 8px; }
.cart_coupon_input_row input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; }
.cart_totals_box { flex: 1 1 300px; max-width: 380px; background: #fafafa; padding: 20px; border-radius: 6px; }
.cart_totals_line { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.cart_totals_grand { font-size: 18px; font-weight: 700; border-top: 1px solid #ddd; padding-top: 10px; }
.cart_checkout_btn { display: block; width: 100%; text-align: center; margin-top: 14px; }
.cart_continue_link { display: block; text-align: center; margin-top: 10px; }
.cart_empty_state { text-align: center; padding: 80px 0; color: #888; }
.cart_empty_state i { font-size: 48px; margin-bottom: 16px; display: block; }

/* ---------- Product detail page ---------- */
.pdp_wrap { padding: 30px 0 60px; }
.pdp_breadcrumb { font-size: 13px; color: #888; margin-bottom: 20px; }
.pdp_breadcrumb a { color: #888; }
.pdp_main_image_wrap { border: 1px solid #eee; border-radius: 6px; overflow: hidden; }
.pdp_main_image_wrap img { width: 100%; height: 460px; object-fit: cover; }
.pdp_thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pdp_thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.pdp_thumb.is-active { border-color: var(--theme_color_3, #D41A20); }
.pdp_product_name { font-size: 28px; margin-bottom: 6px; }
.pdp_sku { color: #888; font-size: 13px; margin-bottom: 14px; }
.pdp_price_row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.pdp_price_sale { font-size: 26px; font-weight: 700; color: var(--theme_color_3, #D41A20); }
.pdp_price_mrp { text-decoration: line-through; color: #999; }
.pdp_stock_status { margin-bottom: 16px; }
.badge_in_stock { color: #1a7a1a; font-weight: 600; }
.badge_low_stock { color: #E8A33D; font-weight: 600; }
.badge_out_of_stock { color: #c0392b; font-weight: 600; }
.pdp_variation_select_wrap { margin-bottom: 16px; max-width: 260px; }
.pdp_qty_row { margin-bottom: 20px; }
.pdp_qty_row label { display: block; margin-bottom: 6px; }
.pdp_action_row { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.pdp_wishlist_btn { background: none; border: 1px solid #ddd; border-radius: 4px; width: 44px; height: 44px; font-size: 18px; cursor: pointer; color: #333; }
.pdp_wishlist_btn.is-active { color: var(--theme_color_3, #D41A20); border-color: var(--theme_color_3, #D41A20); }
.pdp_meta_block { font-size: 14px; color: #555; }
.pdp_tabs_section { margin-top: 50px; }
.pdp_description { margin-bottom: 30px; line-height: 1.7; }
.pdp_reviews_placeholder { color: #888; }
.pdp_review_item { border-bottom: 1px solid #eee; padding: 14px 0; }
.pdp_review_stars { color: #E8A33D; letter-spacing: 2px; }
.pdp_review_verified { font-size: 11px; background: #e8f7e8; color: #1a7a1a; padding: 2px 8px; border-radius: 3px; margin-left: 8px; }
.pdp_review_form_box { margin-top: 24px; max-width: 500px; }
.pdp_related_section, .pdp_recently_viewed_section { margin-top: 50px; }
.pdp_related_card { display: block; text-decoration: none; color: inherit; }
.pdp_related_card img { width: 100%; height: 180px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.pdp_related_name { font-weight: 600; font-size: 14px; }
.pdp_related_price { color: var(--theme_color_3, #D41A20); font-weight: 600; }
.pdp_not_found { text-align: center; padding: 80px 0; }

/* ---------- Auth pages (login/register/forgot/reset) ---------- */
.auth_page_wrap { display: flex; justify-content: center; padding: 50px 0 70px; }
.auth_form_box { width: 100%; max-width: 420px; background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 32px; }
.auth_form_box h2 { margin-bottom: 8px; }
.auth_form_help { color: #888; font-size: 14px; margin-bottom: 20px; }
.auth_submit_btn { width: 100%; margin-top: 6px; }
.auth_links { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; text-align: center; font-size: 14px; }

/* ---------- Account section (dashboard/profile/addresses/orders/wishlist) ---------- */
.account_page_wrap { padding: 30px 0 60px; }
.account_layout { display: flex; gap: 30px; flex-wrap: wrap; }
.account_sidebar { flex: 0 0 220px; }
.account_sidebar ul { list-style: none; padding: 0; margin: 0; border: 1px solid #eee; border-radius: 6px; overflow: hidden; }
.account_sidebar li a { display: block; padding: 12px 16px; color: #333; text-decoration: none; border-bottom: 1px solid #f2f2f2; }
.account_sidebar li:last-child a { border-bottom: none; }
.account_sidebar li.is-active a, .account_sidebar li a:hover { background: var(--theme_color_3, #D41A20); color: #fff; }
.account_content { flex: 1 1 500px; }
.account_content h2 { margin-bottom: 20px; }
.account_card { background: #fff; border: 1px solid #eee; border-radius: 6px; padding: 24px; margin-bottom: 20px; }
.account_empty_state { text-align: center; color: #888; padding: 50px 0; }
.address_card { border: 1px solid #eee; border-radius: 6px; padding: 16px; margin-bottom: 14px; position: relative; }
.address_card_badges { margin-bottom: 6px; }
.address_default_badge { font-size: 11px; background: var(--theme_color_3, #D41A20); color: #fff; padding: 2px 8px; border-radius: 3px; margin-right: 6px; }
.address_card_actions { margin-top: 10px; display: flex; gap: 10px; }
.orders_table { width: 100%; border-collapse: collapse; }
.orders_table th, .orders_table td { padding: 12px 10px; border-bottom: 1px solid #eee; text-align: left; }

/* ---------- Checkout ---------- */
.checkout_page_wrap { padding: 30px 0 60px; }
.checkout_section { background: #fff; border: 1px solid #eee; border-radius: 6px; padding: 20px; margin-bottom: 20px; }
.checkout_section h4 { margin-bottom: 16px; }
.checkout_summary_box { background: #fafafa; border-radius: 6px; padding: 20px; position: sticky; top: 20px; }
.checkout_summary_item { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.checkout_summary_item img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.checkout_summary_item_info { flex: 1; font-size: 13px; }
.checkout_coupon_row { display: flex; gap: 8px; margin: 16px 0; }
.checkout_coupon_row input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; }
.checkout_place_order_btn { width: 100%; margin-top: 14px; }

/* ---------- Order success ---------- */
.order_success_wrap { padding: 50px 0 70px; text-align: center; }
.order_success_icon { font-size: 60px; color: #1a7a1a; margin-bottom: 16px; }
.order_success_box { max-width: 700px; margin: 0 auto; text-align: left; background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 30px; }
.order_success_meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 16px; }
.order_success_actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

@media print {
    .headerbar, .hdr_action_bar, footer, .order_success_actions, .mini_cart_drawer, .mini_cart_overlay { display: none !important; }
}

@media (max-width: 768px) {
    .pdp_main_image_wrap img { height: 300px; }
    .hdr_action_bar { padding: 10px 14px; }
    .cart_product_cell { min-width: 160px; }
}
