/**
 * -----------------------------------------
 * SAYR WATCHES
 * Product Modal & Checkout Sheets Stylesheet
 *
 * Responsibility:
 * Layout, overlay panels, sliding sheets, image zoom, spec accordions,
 * and review modals.
 *
 * Dependencies:
 * css/variables.css
 *
 * Ownership Boundary:
 * Premium Storefront (Details Modal & Checkout Styling)
 * -----------------------------------------
 */

/* ─── MODAL LAYOUT ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  cursor: pointer;
}

.modal-video-slide {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-video-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.modal-carousel-slide--video {
  background: radial-gradient(ellipse at center, #F8F5EE 0%, #EDE9E0 100%);
}
.modal-carousel-slide--video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: transparent;
}

/* ─── MODAL DETAIL SECTIONS ───────────────────────────────────── */
.modal-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-color-row {
  margin-bottom: 20px;
}

.modal-color-row .t-label {
  margin-bottom: 10px;
}

.modal-color-label {
  color: var(--gold);
  font-weight: 400;
}

.modal-color-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.modal-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.modal-features-row {
  margin-bottom: 20px;
}

.modal-features-row .t-label {
  margin-bottom: 8px;
}

.modal-features-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-strap-row {
  margin-bottom: 20px;
}

.modal-strap-row .t-label {
  margin-bottom: 8px;
}

.modal-strap-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-spec-row {
  margin-bottom: 20px;
}

.modal-cta-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-reviews-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ─── TRUST BADGES ────────────────────────────────────────────── */
.trust-badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

/* ─── PAYMENT SHEET ───────────────────────────────────────────── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #111;
  border: 1px solid rgba(198,167,94,0.2);
  border-bottom: none;
  padding: 32px 24px 40px;
  z-index: 1;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.16,1,0.3,1);
}

.sheet-handle {
  width: 44px;
  height: 4px;
  background: rgba(198,167,94,0.4);
  border-radius: 4px;
  margin: 0 auto 20px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(198,167,94,0.2);
  transition: background 0.2s ease, transform 0.2s ease;
}

.sheet-handle:hover,
.sheet-handle:active {
  background: var(--gold);
  transform: scaleX(1.15);
}

.sheet-step-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(198,167,94,0.6);
  margin-bottom: 6px;
}

.sheet-heading {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: #F8F6F1;
  margin-bottom: 4px;
}

.sheet-subtext {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  color: #5A5650;
  margin-bottom: 28px;
}

/* ─── PAYMENT OPTION CARDS ────────────────────────────────────── */
.pay-option {
  padding: 16px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.28s, background 0.28s;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.pay-option--gold {
  border-color: rgba(198,167,94,0.22);
}

.pay-option-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pay-option-left {
  flex: 1;
}

.pay-option-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pay-option-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: #F8F6F1;
  font-weight: 500;
}

.pay-option-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: #5A5650;
}

.pay-option-deposit-note {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  color: rgba(198,167,94,0.55);
  margin-top: 4px;
}

.pay-option-right {
  text-align: right;
  flex-shrink: 0;
}

.pay-option-price {
  font-family: 'Libre Baskerville', serif;
  font-size: 1rem;
  color: #C6A75E;
}

.pay-option-saving {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  color: #5dba88;
}

.pay-option-due {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  color: #5A5650;
}

.pay-save-badge {
  background: rgba(93,186,136,0.15);
  color: #5dba88;
  border: 1px solid rgba(93,186,136,0.3);
  font-size: 0.6rem;
  padding: 2px 8px;
  letter-spacing: 0.1em;
  font-family: 'DM Sans', sans-serif;
}

.pay-cod-badge {
  background: rgba(198,167,94,0.1);
  color: rgba(198,167,94,0.8);
  border: 1px solid rgba(198,167,94,0.22);
  font-size: 0.6rem;
  padding: 2px 8px;
  letter-spacing: 0.1em;
  font-family: 'DM Sans', sans-serif;
}

.pay-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s, border-color 0.25s;
  opacity: 0;
}

.pay-check svg {
  width: 8px;
  height: 8px;
  fill: #C6A75E;
}

.cod-info-box {
  background: rgba(198,167,94,0.04);
  border: 1px solid rgba(198,167,94,0.12);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  color: #5A5650;
  line-height: 1.55;
  display: none;
}

.pay-next-btn {
  width: 100%;
  padding: 16px;
  background: rgba(198,167,94,0.12);
  border: 1px solid rgba(198,167,94,0.25);
  color: rgba(198,167,94,0.4);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: not-allowed;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.pay-next-btn.enabled {
  background: var(--gold);
  color: #111;
  cursor: pointer;
  border-color: var(--gold);
}

/* ─── ADDRESS SHEET ───────────────────────────────────────────── */
.addr-sheet-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #111;
  border: 1px solid rgba(198,167,94,0.2);
  border-bottom: none;
  max-height: 92vh;
  overflow-y: auto;
  z-index: 1;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.16,1,0.3,1);
}

.addr-sticky-header {
  padding: 24px 24px 0;
  position: sticky;
  top: 0;
  background: #111;
  z-index: 2;
}

.addr-body {
  padding: 0 24px 40px;
}

.addr-error {
  display: none;
  background: rgba(192,112,106,0.1);
  border: 1px solid rgba(192,112,106,0.3);
  color: #c0706a;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.addr-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.addr-field {
  margin-bottom: 14px;
}

.addr-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(198,167,94,0.7);
  margin-bottom: 6px;
}

.addr-required {
  color: #c0706a;
}

.addr-hint {
  color: #5A5650;
  text-transform: none;
  letter-spacing: 0;
}

.addr-input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  color: #F8F6F1;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  border-radius: 0;
}

.addr-input:focus {
  border-color: rgba(198,167,94,0.5);
}

.addr-footer-note {
  margin-top: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  color: #5A5650;
  text-align: center;
}

/* ─── REVIEW MODAL RESPONSIVE STYLING ──────────────────────────── */
.review-modal-container {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-modal-container.hidden {
  display: none;
}

.review-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10051;
}

.review-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 10052;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  overflow-y: auto;
}

.review-modal-card {
  pointer-events: auto;
  background: #FFFFFF;
  color: #1A1A1A;
  border: 1px solid #EAE6DE;
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 60px rgba(15, 35, 58, 0.4);
  margin: auto;
}

.review-modal-header {
  padding: 24px 20px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #F0ECE1;
}

.review-modal-subtitle {
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #C8A45D;
  font-family: 'DM Sans', sans-serif;
  margin: 0 0 4px;
}

.review-modal-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0;
}

#reviewForm {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-form-input,
.review-form-textarea,
#revName, #revSocial, #revCity, #revComment {
  background: #F8F5EE;
  border: 1px solid #E2DCD0;
  color: #1A1A1A;
  font-size: 16px; /* Prevents auto-zoom on mobile Chrome/Safari */
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  box-sizing: border-box;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.review-form-input:focus,
.review-form-textarea:focus,
#revName:focus, #revSocial:focus, #revCity:focus, #revComment:focus {
  border-color: #C8A45D;
  background: #FFFFFF;
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 164, 93, 0.15);
}

/* ─── MOBILE FULL-SCREEN MODAL & REVIEWS (<768px) ──────────── */
@media (max-width: 767px) {
  .modal-wrap {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }
  
  .modal-box {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    margin: 0;
    transform: translateY(0);
    animation: sheetSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  .modal-close-btn {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    z-index: 900;
  }
  
  .modal-detail {
    padding: 20px 18px max(28px, env(safe-area-inset-bottom));
  }

  .review-modal-wrapper {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }
  .review-modal-card {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    margin: 0;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
