/*
Theme Name: Brick Drive
Theme URI: https://themeforest.net/item/brickdrive
Author: Your Name
Author URI: https://yourwebsite.com
Description: Brick Drive is a premium WooCommerce theme built for model car and collectible toy stores. Features include a fully customizable homepage, product badge system, bulk discount engine, AJAX cart drawer, smooth animations, and mobile-first responsive design. Perfect for LEGO-compatible and die-cast model car retailers.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: brickdrive
Tags: woocommerce, e-commerce, custom-colors, custom-logo, custom-menu, featured-images, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready, block-styles, wide-blocks, one-column, two-columns, left-sidebar, right-sidebar, blog, portfolio, shopping
*/

/* Section spacing */
section { margin-bottom: 0 !important; }
.bd-hero + section { margin-top: 0; }

/* Checkout & Cart full width */
body.bd-full-page .page-wrap { max-width: none !important; padding: 0 !important; margin: 0 !important; }
body.woocommerce-checkout .woocommerce,
body.woocommerce-cart .woocommerce { max-width: 1100px; margin: 40px auto; padding: 0 40px 80px; display: block; }
body.woocommerce-checkout #customer_details { float: left; width: 55%; }
body.woocommerce-checkout #order_review_heading,
body.woocommerce-checkout #order_review { float: right; width: 40%; }
body.woocommerce-checkout .woocommerce-billing-fields input,
body.woocommerce-checkout .woocommerce-shipping-fields input,
body.woocommerce-checkout select,
body.woocommerce-checkout textarea { width: 100% !important; padding: 12px 14px !important; border: 1.5px solid #ececec !important; border-radius: 10px !important; font-size: 14px !important; font-family: inherit !important; outline: none !important; }
body.woocommerce-checkout .woocommerce-billing-fields input:focus { border-color: #111 !important; }
body.woocommerce-checkout #place_order { width: 100% !important; padding: 15px !important; background: #111 !important; color: #fff !important; border: none !important; border-radius: 12px !important; font-size: 15px !important; font-weight: 700 !important; cursor: pointer !important; }
body.woocommerce-checkout #place_order:hover { background: #333 !important; }
body.woocommerce-cart .woocommerce-cart-form table { width: 100%; border-collapse: collapse; }
body.woocommerce-cart .woocommerce-cart-form table th { padding: 12px 0; border-bottom: 2px solid #eee; font-size: 13px; font-weight: 700; text-align: left; }
body.woocommerce-cart .woocommerce-cart-form table td { padding: 16px 0; border-bottom: 1px solid #f0f0f0; }
body.woocommerce-cart .checkout-button { background: #111 !important; color: #fff !important; border-radius: 12px !important; padding: 14px 28px !important; font-weight: 700 !important; font-size: 14px !important; }

/* ===== CHECKOUT PAGE STYLING ===== */
.woocommerce-checkout .woocommerce {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 40px 80px;
    display: block !important;
}
.woocommerce-checkout #customer_details,
.woocommerce-checkout .col-1,
.woocommerce-checkout .col-2 {
    width: 100% !important;
    float: none !important;
}
.woocommerce-checkout .woocommerce-checkout-review-order {
    width: 100% !important;
    float: none !important;
}
/* Grid layout */
.woocommerce-checkout form.checkout {
    display: grid !important;
    grid-template-columns: 1fr 380px !important;
    grid-template-rows: auto !important;
    gap: 32px !important;
    align-items: start !important;
}
.woocommerce-checkout form.checkout #customer_details {
    grid-column: 1 !important;
    grid-row: 1 !important;
}
.woocommerce-checkout form.checkout #order_review_heading {
    grid-column: 2 !important;
    grid-row: 1 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
    background: #fff;
    padding: 20px 28px 0;
    border-radius: 16px 16px 0 0;
    border: 1.5px solid #f0f0f0;
    border-bottom: none;
    margin: 0 !important;
}
.woocommerce-checkout form.checkout #order_review {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin-top: 48px !important;
    background: #fff;
    border-radius: 0 0 16px 16px;
    border: 1.5px solid #f0f0f0;
    border-top: none;
    padding: 0 28px 28px;
}
/* Billing/shipping boxes */
.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields {
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    border: 1.5px solid #f0f0f0;
    margin-bottom: 20px;
}
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout .woocommerce-additional-fields h3 {
    font-size: 13px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
    color: #111 !important;
    margin: 0 0 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 2px solid #f5f5f5 !important;
}
/* Form fields */
.woocommerce-checkout .form-row { margin-bottom: 14px !important; padding: 0 !important; }
.woocommerce-checkout label {
    display: block !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #999 !important;
    letter-spacing: .07em !important;
    text-transform: uppercase !important;
    margin-bottom: 6px !important;
}
.woocommerce-checkout input.input-text,
.woocommerce-checkout select,
.woocommerce-checkout textarea {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 1.5px solid #ececec !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #111 !important;
    background: #fafafa !important;
    outline: none !important;
    transition: border-color .2s !important;
    box-shadow: none !important;
}
.woocommerce-checkout input.input-text:focus,
.woocommerce-checkout select:focus {
    border-color: #111 !important;
    background: #fff !important;
}
.woocommerce-checkout .form-row-first { float: left !important; width: 47% !important; }
.woocommerce-checkout .form-row-last { float: right !important; width: 47% !important; }
.select2-container .select2-selection--single {
    height: 46px !important;
    border: 1.5px solid #ececec !important;
    border-radius: 10px !important;
    background: #fafafa !important;
}
.select2-container .select2-selection--single .select2-selection__rendered { line-height: 46px !important; padding-left: 14px !important; font-size: 14px !important; }
.select2-container .select2-selection--single .select2-selection__arrow { height: 44px !important; }
/* Order review table */
.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
}
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 10px 0 !important;
    border-bottom: 1px solid #f5f5f5 !important;
    text-align: left !important;
}
.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    font-size: 16px !important;
    font-weight: 900 !important;
    border-top: 2px solid #111 !important;
    border-bottom: none !important;
    padding-top: 14px !important;
}

/* Global overflow fix */
html, body { overflow-x: hidden !important; width: 100% !important; }
* { max-width: 100%; }

@media(max-width:900px) {
  /* Header */
  #bd-nav { padding: 0 16px !important; }
  #bd-searchbox { padding: 12px 16px !important; }

  /* Homepage sections */
  .bd-section, [class*="bd-wrap"], [class*="bd-container"] { padding-left: 16px !important; padding-right: 16px !important; }

  /* Product grids */
  .bd-grid, [class*="bd-products"] { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }

  /* Footer */
  footer > div:first-child { grid-template-columns: 1fr !important; padding: 32px 20px !important; gap: 24px !important; }
  footer > div:last-child { padding: 16px 20px !important; flex-direction: column !important; gap: 8px !important; }

  /* Checkout */
  .bdco-wrap { grid-template-columns: 1fr !important; padding: 20px 16px 60px !important; }
  .bdco-row { grid-template-columns: 1fr 1fr !important; }
  .bdco-right { position: static !important; }

  /* Cart drawer */
  #bd-cart, #bd-qa-drawer { width: 100vw !important; max-width: 100vw !important; }
}

@media(max-width:480px) {
  .bd-grid, [class*="bd-products"] { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .bdco-row { grid-template-columns: 1fr !important; }
  .ty-meta { grid-template-columns: 1fr 1fr !important; }
  .ty-actions { flex-direction: column !important; }
}

@media(max-width:900px) {
  /* Sections padding */
  [style*="padding:0 60px"], [style*="padding: 0 60px"] { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="padding:0 40px"], [style*="padding: 0 40px"] { padding-left: 16px !important; padding-right: 16px !important; }

  /* Product grids 4 col → 2 col */
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: repeat(2,1fr) !important; }

  /* Features 4 col → 2 col */
  [style*="grid-template-columns:repeat(4,1fr)"] { grid-template-columns: repeat(2,1fr) !important; }

  /* Model of month 2 col → 1 col */
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }

  /* Categories grid → 1 col */
  [style*="grid-template-columns:1fr 1fr 2fr"] { grid-template-columns: 1fr 1fr !important; grid-template-rows: auto !important; }

  /* FAQ padding */
  [style*="padding:0 60px;"] { padding: 0 20px !important; }

  /* Model of month section padding */
  [style*="padding:0 60px 64px"] { padding: 0 20px 40px !important; }

  /* Subscription */
  [style*="padding:40px 40px"] { padding: 28px 20px !important; }
  [style*="padding:32px 40px"] { padding: 24px 20px !important; }
}

@media(max-width:480px) {
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: repeat(2,1fr) !important; }
  [style*="grid-template-columns:1fr 1fr 2fr"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}
