/**
 * Order Online Button & Modal Styles (v2)
 *
 * All pages. Mobile-first.
 * Breakpoint: 1100px (matches parent theme tamarind's responsive.css).
 *
 * tamarind switches to mobile header (.responsive-menu-wrap) at max-width: 1100px.
 * The desktop header (.outer-wrap) is hidden below 1101px.
 *
 * @package sushi-nigiriba
 */

/* ==========================================================================
   Component: Order Online Button (.c-order-online-btn)
   FLOCSS Component — 再利用可能。赤背景 + SVG テキスト画像。
   ========================================================================== */
.c-order-online-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ed1c24;
  background-image: url('../images/text_order-online.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: auto 50%;
  border: none;
  cursor: pointer;
  transition: filter 0.3s ease;
  /* テキストは SVG 画像で表示するため非表示 */
  color: transparent;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}

.c-order-online-btn:hover,
.c-order-online-btn:focus {
  filter: brightness(1.15);
}

.c-order-online-btn:active {
  filter: brightness(0.95);
}

/* ==========================================================================
   Component: Order Online Text Button (.c-order-online-text-btn)
   FLOCSS Component — 再利用可能。赤背景 + 白テキスト。
   ========================================================================== */
.c-order-online-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: #ed1c24;
  color: #fff;
  text-decoration: none;
  font-family: 'Open Sans', serif;
  font-size: 13px;
  font-weight: 400;
  border: none;
  cursor: pointer;
  transition:
    filter 0.3s ease,
    transform 0.3s ease;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  text-decoration: none !important;
}

.c-order-online-text-btn:hover,
.c-order-online-text-btn:focus {
  filter: brightness(1.15);
  transform: translateY(-2px);
  color: #fff;
}

.c-order-online-text-btn:active {
  filter: brightness(0.95);
  transform: translateY(0);
}

/* ==========================================================================
   Trigger Button: Initial state (hidden until JS places it)
   ========================================================================== */
.p-order-online-trigger {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.p-order-online-trigger.is-placed {
  opacity: 1;
}

/* ==========================================================================
   Trigger Button: Mobile (full-width bar below header)
   Default (mobile-first): fixed bar below mobile header (65px)
   ========================================================================== */
.p-order-online-trigger__button {
  width: 100%;
  height: 44px;
  padding: 8px 16px;
  background-size: auto 50%;
}

/* Mobile: fixed bar below mobile header */
@media (max-width: 1100px) {
  .p-order-online-trigger {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    z-index: 99;
  }
}

/* ==========================================================================
   Desktop: .mainmenu-navigation CSS Grid override
   Only applies when desktop header (.outer-wrap) is visible (> 1100px)
   ========================================================================== */
@media (min-width: 1101px) {
  /* Grid 化 */
  .menu-is-horizontal .mainmenu-navigation {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: 'logo nav order';
    align-items: center;
    min-height: 94px;
    text-align: initial;
  }

  /* Logo: float リセット */
  .menu-is-horizontal .mainmenu-navigation .header-logo-section,
  .menu-is-horizontal.left-logo .mainmenu-navigation .header-logo-section {
    grid-area: logo;
    float: none !important;
    display: flex;
    align-items: center;
  }

  /* Nav: inline-block → flex */
  .menu-is-horizontal .mainmenu-navigation .homemenu {
    grid-area: nav;
    display: flex !important;
    justify-content: center;
    align-items: center;
    line-height: normal;
    position: relative;
  }

  /* Order Online trigger */
  .menu-is-horizontal .mainmenu-navigation .p-order-online-trigger {
    grid-area: order;
    justify-self: end;
    position: static;
  }

  .p-order-online-trigger__button {
    width: 160px;
    height: 40px;
    padding: 8px 16px;
    background-size: auto 50%;
  }
}

@media (min-width: 1280px) {
  .p-order-online-trigger__button {
    width: 180px;
    height: 44px;
    padding: 8px 20px;
  }
}

/* ==========================================================================
   Modal: Base
   ========================================================================== */
.p-order-online-modal {
  position: fixed;
  z-index: 10000;
  background-color: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Transition enabled after initial positioning is complete */
.p-order-online-modal.is-ready {
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

/* Visible state */
.p-order-online-modal.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ==========================================================================
   Modal: Desktop (dropdown below button)
   ========================================================================== */
.p-order-online-modal.is-desktop {
  width: 420px;
  top: var(--modal-top, 50%);
  left: var(--modal-left, 50%);
  transform: var(--modal-transform, translate(-50%, -50%));
}

/* ==========================================================================
   Modal: Mobile (centered overlay)
   ========================================================================== */
.p-order-online-modal.is-mobile {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 380px;
  max-height: 80vh;
  overflow: auto;
}

/* ==========================================================================
   Modal: Content
   ========================================================================== */
.p-order-online-modal__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  position: relative;
  z-index: 1;
}

@media (min-width: 1101px) {
  .p-order-online-modal__content {
    gap: 12px;
    padding: 16px;
  }
}

/* ==========================================================================
   Modal: Close Button
   ========================================================================== */
.p-order-online-modal__close-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.88);
  border: none;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    transform 0.3s ease;
  align-self: flex-end;
  line-height: 1;

  /* Animation: hidden initially */
  opacity: 0;
}

.p-order-online-modal__close-button.is-animated {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.p-order-online-modal__close-button:hover {
  background-color: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
}

.p-order-online-modal__close-button:active {
  transform: translateY(0);
}

.p-order-online-modal__close-icon {
  display: block;
  width: 15px;
  height: 15px;
  color: #1a1a1a;
}

.p-order-online-modal__close-icon svg {
  width: 100%;
  height: 100%;
}

@media (min-width: 1101px) {
  .p-order-online-modal__close-button {
    padding: 12px;
  }
}

/* ==========================================================================
   Modal: Store Cards
   ========================================================================== */
.p-order-online-modal__card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background-color: #1a1a1a;

  /* Animation: hidden initially */
  opacity: 0;
}

.p-order-online-modal__card.is-animated {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Mobile: stack vertically, center aligned */
.p-order-online-modal.is-mobile .p-order-online-modal__card {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

@media (min-width: 1101px) {
  .p-order-online-modal__card {
    padding: 20px 24px;
  }
}

/* ==========================================================================
   Modal: Location Name
   ========================================================================== */
.p-order-online-modal__location-name {
  margin: 0;
  font-family: 'Open Sans', serif;
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  line-height: 1.2;
  letter-spacing: normal;
}

@media (min-width: 1101px) {
  .p-order-online-modal__location-name {
    font-size: 18px;
  }
}

/* ==========================================================================
   Modal: Order Link Button
   ========================================================================== */
.p-order-online-modal__order-button {
  flex-shrink: 0;
}

.p-order-online-modal__order-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background-color: #ed1c24;
  color: #fff;
  text-decoration: none;
  font-family: 'Open Sans', serif;
  font-size: 12px;
  font-weight: 400;
  border: none;
  transition:
    filter 0.3s ease,
    transform 0.3s ease;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.p-order-online-modal__order-link:hover,
.p-order-online-modal__order-link:focus {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

.p-order-online-modal__order-link:active {
  filter: brightness(0.95);
  transform: translateY(0);
}

/* Mobile: auto-width centered button */
.p-order-online-modal.is-mobile .p-order-online-modal__order-link {
  padding: 10px 32px;
  font-size: 11px;
}

@media (min-width: 1101px) {
  .p-order-online-modal__order-link {
    padding: 10px 24px;
    font-size: 13px;
  }
}

/* ==========================================================================
   Screen Reader Only
   ========================================================================== */
.p-order-online-modal__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
