/* =====================================================================
   DOWNSOUTH - site polish + mobile styles
   Loaded LAST in layout/header.php so it can refine everything above it.
   ===================================================================== */

/* ---------- 1. Bootstrap 4 -> 5 compatibility (BS4 was removed) ---------- */
.form-group { margin-bottom: 1rem; }
.font-weight-bold   { font-weight: 700 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-light  { font-weight: 300 !important; }
.btn-block { display: block; width: 100%; }
.ml-1 { margin-left: .25rem !important; } .ml-2 { margin-left: .5rem !important; } .ml-3 { margin-left: 1rem !important; }
.mr-1 { margin-right: .25rem !important; } .mr-2 { margin-right: .5rem !important; } .mr-3 { margin-right: 1rem !important; }
.input-group-append { display: flex; }
.close { float: right; font-size: 1.5rem; font-weight: 700; line-height: 1; color: #000; background: transparent; border: 0; padding: 0; opacity: .5; cursor: pointer; }
.close:hover { opacity: .8; }
.custom-control { position: relative; display: block; min-height: 1.5rem; padding-left: 1.6rem; }
.custom-control-input { position: absolute; left: 0; top: .25rem; width: 1rem; height: 1rem; }
.custom-control-label { margin-bottom: 0; }

/* ---------- 2. Base ---------- */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { overflow-x: clip; -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; }
:focus-visible { outline: 2px solid #DB2009; outline-offset: 2px; }
footer .logo { width: 100px; height: 100px; }            /* fixes the "100x" typo in style.css */
.navbar .logo { width: 100px; height: 100px; object-fit: contain; }

/* friendly "nothing found" block (shop + category) */
.empty-state { text-align: center; padding: 56px 20px; border: 1px dashed #d5d5d5; border-radius: 16px; background: #fafafa; margin: 10px 0 30px; }
.empty-state i { font-size: 2.4rem; color: #bbb; margin-bottom: 14px; display: block; }
.empty-state h5 { font-weight: 700; margin-bottom: 6px; }
.empty-state p { color: #666; margin-bottom: 18px; }

/* ---------- 3. Product page (single.php) ---------- */
.single-product .pdp-title-block { margin-bottom: .5rem; }
.single-product .pdp-brand { font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: #DB2009; font-weight: 700; margin-bottom: .4rem; }
.single-product .pdp-title { font-family: 'Anta', sans-serif; font-size: clamp(1.65rem, 3.2vw, 2.5rem); line-height: 1.15; font-weight: 700; letter-spacing: .01em; color: #111; margin: 0 0 .9rem; text-transform: none; }
.single-product .pdp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .6rem; margin-bottom: 1rem; }
.single-product .pdp-colorway { display: inline-flex; align-items: center; gap: .55rem; padding: .35rem .95rem .35rem .75rem; border: 1px solid #e2e2e2; border-radius: 999px; background: #fafafa; font-size: .95rem; line-height: 1.2; }
.single-product .pdp-colorway-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: #777; font-weight: 700; padding-right: .6rem; border-right: 1px solid #dcdcdc; }
.single-product .pdp-swatches { display: inline-flex; }
.single-product .pdp-swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); display: inline-block; }
.single-product .pdp-swatch + .pdp-swatch { margin-left: -6px; }
.single-product .pdp-colorway-name { font-weight: 600; color: #111; }
.single-product .pdp-gender { display: inline-block; padding: .42rem .9rem; border-radius: 999px; background: #111; color: #fff; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
.single-product .pdp-desc { color: #555; margin-bottom: 1rem; }

.single-product #stockStatusBadge { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border-radius: 999px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.single-product #stockStatusBadge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.single-product #priceDisplay { margin: .7rem 0 1.1rem; line-height: 1.2; }

.single-product .pdp-label { display: block; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: #444; margin-bottom: .2rem; }
.single-product .size-picker-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; margin-top: 10px; max-width: 520px; }
.single-product .size-option { width: auto !important; height: 48px !important; margin: 0 !important; border: 1.5px solid #cfcfcf !important; border-radius: 10px !important; font-weight: 600 !important; font-size: .9rem !important; transition: border-color .15s, background-color .15s, color .15s, transform .1s; }
.single-product .size-option:hover:not(.disabled):not(:disabled) { border-color: #000 !important; }
.single-product .size-option:active:not(.disabled):not(:disabled) { transform: scale(.97); }
.single-product .size-option.selected { background-color: #000 !important; color: #fff !important; border-color: #000 !important; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.single-product #selectedSizeText { font-size: 1rem !important; margin-top: .6rem !important; }

.single-product .black-button { width: 100%; max-width: 520px; display: block; padding: 15px 24px !important; border-radius: 12px !important; letter-spacing: .06em; text-transform: uppercase; font-weight: 700 !important; font-size: .95rem !important; }
.single-product #openSizeChart.black-button { background: #fff !important; color: #000 !important; border: 1.5px solid #000 !important; margin-top: 12px; }
.single-product #openSizeChart.black-button:hover { background: #f2f2f2 !important; }
.single-product .product-details-card { max-width: 100%; margin-top: 26px; }
.single-product .main-img-box { border-radius: 14px; max-width: 560px; }
.single-product .vertical-thumbs .small-img { border-radius: 10px; }
.single-product .vertical-thumbs .small-img:hover { border-color: #000; }

/* ---------- 4. Tablet & phone (<= 991px): navigation ---------- */
@media (max-width: 991.98px) {
  .navbar > .container { padding-top: 6px; padding-bottom: 6px; }
  .navbar .logo, footer .logo { width: 72px; height: 72px; }
  .custom-toggler { padding: 6px 10px; border-radius: 8px; }
  .custom-toggler .navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); }
  .navbar-collapse { background: #000; border-top: 1px solid #222; padding: .25rem 0 1rem; }
  .navbar-nav .nav-link { padding: .9rem .25rem !important; font-size: 1rem; border-bottom: 1px solid #1c1c1c; }
  .navbar-nav .nav-item:last-child .nav-link { border-bottom: 0; }
}

/* ---------- 5. Phone (<= 767px) ---------- */
@media (max-width: 767.98px) {
  /* stop iPhones zooming into fields, and make taps easy */
  input, select, textarea, .form-control, .form-select { font-size: 16px !important; }
  .btn:not(.btn-sm):not(.btn-close), .black-button, .buy-btn, .custom-buy-btn { min-height: 46px; }
  .container, .container-fluid { padding-left: 16px; padding-right: 16px; }
  section.container { margin-top: 1.5rem; }

  /* homepage hero */
  #home { min-height: 0 !important; padding: 52px 0 36px !important; text-align: center; }
  #home h5 { font-size: 1.05rem; }
  #home h1 span { font-size: 2.1rem !important; }
  #home p { font-size: 1rem; }
  #home .btn-shop, #home button { width: 100%; max-width: 320px; min-height: 48px; }
  #home img.img-fluid { margin-top: 1.5rem !important; max-width: 82%; }
  #auth-carousel { padding-top: 2rem !important; padding-bottom: 2rem !important; }
  #auth-carousel h2 { font-size: 1.35rem; }
  #featured .container-fluid, #featured .row { padding-left: 8px; padding-right: 8px; }
  .section-title { font-size: 1.45rem !important; }
  .section-subtitle { font-size: .9rem !important; padding: 0 12px; }

  /* product cards (home) - two per row */
  .product { padding: 8px !important; }
  .product .product-img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; border-radius: 10px; }
  .product .p-name { font-size: .92rem; line-height: 1.25; margin-bottom: 2px; }
  .product .p-nname { font-size: .78rem; color: #666; }
  .product .p-price { font-size: .95rem; }
  .product .custom-buy-btn { font-size: .8rem; padding: 8px 10px; width: 100%; }

  /* shop / category */
  .card-body { padding: .7rem; }
  .pagination { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .page-link { min-width: 40px; min-height: 40px; display: flex; align-items: center; justify-content: center; }
  .empty-state { padding: 40px 16px; }

  /* contact, forms, login */
  .w-50, .w-75 { width: 100% !important; }
  .login-box, .register-container, .address-book-section { padding-left: 4px; padding-right: 4px; }
  .form-links { flex-direction: column; gap: 8px; align-items: flex-start !important; }

  /* cart / checkout / account / orders */
  .cart-container { margin: 24px auto; padding: 12px; }
  .cart-item { flex-wrap: wrap; gap: 12px; }
  .cart-summary { position: static !important; width: 100% !important; }
  .table-responsive, .account-info table, .receipt-table { -webkit-overflow-scrolling: touch; }

  /* news + faq */
  .accordion-button { padding: .9rem 1rem; font-size: .95rem; }

  /* footer */
  footer .row.container-fluid { padding-left: 20px !important; padding-right: 20px !important; padding-top: 1rem !important; text-align: center; }
  footer .footer-one { margin-bottom: 1.25rem !important; }
  footer .footer-one ul { padding-left: 0; list-style: none; }
  footer li { padding: 5px 0; }
  footer .logo { margin: 0 auto; display: block; }
  footer .copyright .row { text-align: center; }
  footer .copyright img { max-width: 220px; }
  footer .copyright i { font-size: 1.6rem; margin: 0 10px; }

  /* product page */
  .single-product { margin-top: 1rem !important; padding-top: 1rem !important; }
  .single-product > .row { margin-top: 0 !important; }
  .single-product .image-wrapper { flex-direction: column-reverse; gap: 10px; }
  .single-product .vertical-thumbs { flex-direction: row !important; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .single-product .vertical-thumbs .small-img-col { flex: 0 0 auto; }
  .single-product .vertical-thumbs .small-img { width: 62px !important; height: 62px !important; }
  .single-product .main-img-box { max-width: 100%; }
  .single-product .pdp-title { font-size: 1.6rem; }
  .single-product .pdp-colorway { font-size: .9rem; }
  .single-product .size-picker-grid { grid-template-columns: repeat(4, 1fr); max-width: none; }
  .single-product .black-button { max-width: none; }
  /* Add to Cart stays within reach while choosing a size */
  .single-product #addToCartForm .black-button { position: sticky; bottom: 12px; z-index: 20; box-shadow: 0 10px 28px rgba(0,0,0,.3); }
  .related-products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .related-product-img { height: 150px !important; }
  .related-name { font-size: 15px !important; }
  .related-desc { min-height: 0 !important; font-size: 12px !important; }
  #cart-modal { top: 70px !important; padding: 18px !important; }
}

/* ---------- 6. Very small phones (<= 380px) ---------- */
@media (max-width: 380px) {
  #home h1 span { font-size: 1.8rem !important; }
  .single-product .size-picker-grid { grid-template-columns: repeat(3, 1fr); }
  .product .p-name { font-size: .85rem; }
}

/* ---------- 7. Respect reduced-motion settings ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
