/* Tablet Orientation Switcher Styles - متجر الجزيرة */

/* Floating Widget Container */
.tablet-orientation-floating-wrapper {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: calc(18px + env(safe-area-inset-left, 0px));
  z-index: 10050;
  display: flex;
  align-items: center;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* Floating Pill Button */
.tablet-orient-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 41, 59, 0.88) 100%);
  color: #f8fafc;
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.45), 0 0 18px rgba(212, 175, 55, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  outline: none;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  direction: rtl;
}

.tablet-orient-pill:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(212, 175, 55, 0.85);
  box-shadow: 0 14px 34px -4px rgba(0, 0, 0, 0.55), 0 0 24px rgba(212, 175, 55, 0.4);
  background: linear-gradient(135deg, rgba(20, 30, 55, 0.96) 0%, rgba(35, 48, 71, 0.92) 100%);
}

.tablet-orient-pill:active {
  transform: translateY(1px) scale(0.98);
}

/* Orientation Icon Animation */
.tablet-orient-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(212, 175, 55, 0.3);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}

.tablet-orient-icon.icon-landscape {
  transform: rotate(90deg);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.16);
}

.tablet-orient-icon.icon-portrait {
  transform: rotate(0deg);
  color: #fbbf24;
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.16);
}

.tablet-orient-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  line-height: 1.25;
}

.tablet-orient-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.2px;
}

.tablet-orient-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fbbf24;
}

.tablet-orient-icon.icon-landscape ~ .tablet-orient-text .tablet-orient-tag {
  color: #38bdf8;
}

/* Header Button Style */
.tablet-orientation-header-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tablet-orientation-header-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.7);
  transform: translateY(-1px);
}

/* Show in header when tablet app mode active */
html.tablet-app-mode-active .tablet-orientation-header-btn {
  display: inline-flex;
}

/* Toast Notifications */
#tablet-orientation-toast {
  position: fixed;
  top: calc(24px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translate(-50%, -24px) scale(0.94);
  opacity: 0;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 12000;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  direction: rtl;
  transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.25s ease;
}

#tablet-orientation-toast.tot-visible {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

#tablet-orientation-toast .tot-icon {
  display: flex;
  align-items: center;
  color: #fbbf24;
}

/* Landscape adaptation rules for tablet app mode */
html[data-tablet-orientation="landscape"] .container,
html.tablet-orientation-landscape .container {
  width: min(1380px, calc(100% - 48px)) !important;
  max-width: 1380px !important;
}

html[data-tablet-orientation="landscape"] #featuredSection .products-grid.grid,
html[data-tablet-orientation="landscape"] #varyingSection .products-grid.grid,
html.tablet-orientation-landscape #featuredSection .products-grid.grid,
html.tablet-orientation-landscape #varyingSection .products-grid.grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  gap: 16px !important;
}
