/* ========================================
   Dawn Theme Fixes
   Ensure product descriptions, footers, and
   custom elements display without Shopify JS
   ======================================== */

/* Breadcrumbs (extracted from inline styles) */
.breadcrumbs {
  margin: 1em;
}
.breadcrumbs__list {
  list-style-type: none;
  margin: 0;
  padding: 0;
}
.breadcrumbs__item {
  display: inline-block;
}
.breadcrumbs__item:not(:last-child):after {
  border-style: solid;
  border-width: .10em .10em 0 0;
  content: '';
  display: inline-block;
  height: .20em;
  margin: 0 .20em;
  position: relative;
  transform: rotate(45deg);
  vertical-align: middle;
  width: .20em;
}
.breadcrumbs__link {
  text-decoration: underline;
}
.breadcrumbs__link[aria-current="page"] {
  color: inherit;
  font-weight: normal;
  text-decoration: none;
}
.breadcrumbs__link[aria-current="page"]:hover,
.breadcrumbs__link[aria-current="page"]:focus {
  text-decoration: underline;
}

/* Fix .button text color after removing button--primary */
.button {
  color: rgb(255, 255, 255) !important;
}

/* Slideshow buttons olive green */
.slideshow__text .banner__buttons .button {
  background-color: #556B2F !important;
  border-color: #527c09 !important;
}

/* Fix mobile menu drawer (Dawn needs .js or .no-js class on <html>) */
details[open] > .menu-drawer {
  transform: translate(0) !important;
  visibility: visible !important;
}

details[open] > .menu-drawer__submenu {
  transform: translate(0) !important;
  visibility: visible !important;
}

/* Overlay behind open menu drawer */
menu-drawer > details[open] > summary::before {
  visibility: visible !important;
  opacity: 1 !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

/* Make sure product description is visible */
.product__description.rte {
  display: block !important;
  visibility: visible !important;
}

/* Fix variant radios/selects display */
variant-radios,
variant-selects {
  display: block !important;
}

/* Ensure footer is visible */
.shopify-section + .shopify-section,
#shopify-section-footer {
  display: block !important;
  visibility: visible !important;
}

footer.footer {
  display: block !important;
  visibility: visible !important;
}

/* Fix product grid layout when custom elements don't initialize */
product-info {
  display: block !important;
}

/* Ensure product-form is visible */
product-form {
  display: block !important;
}

/* Fix pickup-availability (not functional without Shopify) */
pickup-availability {
  display: none !important;
}

/* Fix sticky product info container cutting off description/footer */
.product__info-container--sticky {
  position: static !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Fix media gallery display without JS */
media-gallery {
  display: block !important;
}

slider-component {
  display: block !important;
  overflow: visible !important;
}

/* Ensure slider items are visible without JS */
.slider--mobile .slider__slide {
  display: block !important;
}

/* Fix product modal opener to show images */
modal-opener {
  display: block !important;
}

/* Hide share button on product pages */
share-button {
  display: none !important;
}

/* Hide non-functional Shopify elements */
cart-notification,
shop-login-button,
shopify-accelerated-checkout,
shopify-accelerated-checkout-cart,
shopify-payment-terms {
  display: none !important;
}

/* ========================================
   Cart Drawer
   ======================================== */

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
}

.cart-drawer.open {
  right: 0;
}

.cart-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.cart-drawer__header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.cart-drawer__close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 0;
  line-height: 1;
}

.cart-drawer__close:hover {
  color: #000;
}

/* ========================================
   Cart Items
   ======================================== */

.cart-drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-drawer__item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
}

.cart-drawer__item:last-child {
  border-bottom: none;
}

.cart-drawer__item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.cart-drawer__item-details {
  flex: 1;
  min-width: 0;
}

.cart-drawer__item-name {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-drawer__item-variant {
  margin: 0 0 4px;
  font-size: 12px;
  color: #888;
}

.cart-drawer__item-price {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.cart-drawer__item-quantity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: background 0.2s;
}

.qty-btn:hover {
  background: #f5f5f5;
}

.qty-value {
  font-size: 14px;
  min-width: 20px;
  text-align: center;
}

.cart-drawer__item-remove {
  position: absolute;
  top: 16px;
  right: 0;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
}

.cart-drawer__item-remove:hover {
  color: #e44;
}

/* ========================================
   Cart Footer
   ======================================== */

.cart-drawer__footer {
  padding: 20px 24px;
  border-top: 1px solid #eee;
}

.cart-drawer__subtotal {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.cart-drawer__checkout-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: #333;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
  box-sizing: border-box;
}

.cart-drawer__checkout-btn:hover {
  background: #555;
}

.cart-drawer__view-cart {
  display: block;
  text-align: center;
  margin-top: 12px;
  color: #666;
  text-decoration: underline;
  font-size: 13px;
}

/* ========================================
   Empty Cart
   ======================================== */

.cart-drawer__empty {
  display: none;
  text-align: center;
  padding: 60px 24px;
  flex: 1;
}

.cart-drawer__empty p {
  color: #888;
  font-size: 16px;
  margin-bottom: 20px;
}

.cart-drawer__empty a {
  color: #333;
  text-decoration: underline;
}

/* ========================================
   Cart Badge
   ======================================== */

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #000 !important;
  color: #fff !important;
  font-size: 10px;
  font-weight: 700;
  width: 18px !important;
  height: 18px !important;
  min-width: 0;
  min-height: 0;
  max-width: 18px;
  max-height: 18px;
  border-radius: 50% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 !important;
  box-sizing: border-box;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

/* ========================================
   Floating Cart Button (fallback)
   ======================================== */

.cart-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9990;
  transition: background 0.2s, transform 0.2s;
}

.cart-floating-btn:hover {
  background: #555;
  transform: scale(1.05);
}

.cart-floating-btn .cart-badge {
  top: -4px;
  right: -4px;
}

/* ========================================
   Add to Cart Button Feedback
   ======================================== */

[data-add-to-cart].added {
  background: #4caf50 !important;
  color: #fff !important;
  pointer-events: none;
}

/* ========================================
   Full Cart Page
   ======================================== */

.cart-page {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 24px;
}

.cart-page h1 {
  font-size: 28px;
  margin-bottom: 32px;
}

.cart-page__table {
  width: 100%;
  border-collapse: collapse;
}

.cart-page__table th {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid #eee;
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-page__table td {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.cart-page__product {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cart-page__product img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-page__summary {
  margin-top: 32px;
  text-align: right;
}

.cart-page__total {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.cart-page__checkout-btn {
  display: inline-block;
  padding: 14px 48px;
  background: #333;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
}

.cart-page__checkout-btn:hover {
  background: #555;
}

/* ========================================
   Checkout Page
   ======================================== */

.checkout-page {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
}

.checkout-page__form h1 {
  font-size: 24px;
  margin-bottom: 24px;
}

.checkout-page__form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

.checkout-page__form input,
.checkout-page__form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.checkout-page__form input:focus,
.checkout-page__form select:focus {
  outline: none;
  border-color: #333;
}

.checkout-page__form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkout-page__summary {
  background: #fafafa;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #eee;
  height: fit-content;
  position: sticky;
  top: 24px;
}

.checkout-page__summary h2 {
  font-size: 18px;
  margin: 0 0 16px;
}

.checkout-page__line-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: #555;
}

.checkout-page__line-total {
  display: flex;
  justify-content: space-between;
  padding: 16px 0 0;
  margin-top: 8px;
  border-top: 1px solid #ddd;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.checkout-page__discount {
  margin: 16px 0;
  display: flex;
  gap: 8px;
}

.checkout-page__discount input {
  flex: 1;
  margin-bottom: 0;
}

.checkout-page__discount button {
  padding: 10px 16px;
  background: #eee;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

#paypal-button-container {
  margin-top: 24px;
}

/* ========================================
   Confirmation Page
   ======================================== */

.confirmation-page {
  max-width: 600px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}

.confirmation-page__icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.confirmation-page h1 {
  font-size: 28px;
  margin-bottom: 12px;
}

.confirmation-page p {
  color: #666;
  font-size: 16px;
  line-height: 1.6;
}

.confirmation-page__order-id {
  background: #f5f5f5;
  padding: 12px 24px;
  border-radius: 6px;
  display: inline-block;
  margin: 24px 0;
  font-family: monospace;
  font-size: 16px;
}

.confirmation-page__downloads {
  text-align: left;
  margin: 32px 0;
  padding: 24px;
  background: #f9f9f9;
  border-radius: 8px;
}

.confirmation-page__downloads h3 {
  margin: 0 0 16px;
}

.confirmation-page__downloads a {
  display: block;
  padding: 8px 0;
  color: #0066cc;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .checkout-page {
    grid-template-columns: 1fr;
  }

  .checkout-page__summary {
    position: static;
  }

  .cart-page__table thead {
    display: none;
  }

  .cart-page__table tr {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
  }

  .cart-page__table td {
    display: block;
    padding: 4px 0;
    border: none;
  }
}
