/* SECO Custom Styles */

/* Sweet Alert text styling */
.sweet-alert .lead {
    font-size: 1rem;
    font-weight: 500;
    color: #000 !important;
    margin-bottom: 20px;
    margin-top: 11px;
}

/* Sweet Alert overlay with glass effect */
.sweet-overlay {
    background-color: #ffffff1a;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Mini cart button - relative positioning for badge */
.header-cart-dropdown .icon-btn {
    position: relative;
}

/* Mini cart counter badge - position in corner */
.mini-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
}

/* Hide counter when empty or hidden class */
.mini-cart-count.hidden {
    display: none;
}

/* Show cart dropdown programmatically (not just on hover) */
.header-cart-dropdown.show .cart-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Sticky miniCart - when header is out of viewport */
.header-cart-dropdown.show.sticky-mode .cart-dropdown-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: slideInFromRight 0.3s ease;
}

/* OPENED mode - persistent cart (click on icon, manual close) */
.header-cart-dropdown.opened .cart-dropdown-menu {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
    transition: none !important; /* Disable transition to avoid conflict with animation */
    animation: slideInFromTop 0.3s ease;
}

/* Closing animation - slide out to top */
.header-cart-dropdown.closing .cart-dropdown-menu {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    transition: none !important;
    animation: slideOutToTop 0.3s ease forwards;
}

/* Disable hover when in opened mode */
.header-cart-dropdown.opened:hover .cart-dropdown-menu {
    /* Opened mode doesn't use hover - stays open until close button clicked */
}

/* Close button - only visible in opened mode */
.cart-dropdown-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: #e8e8e8;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.header-cart-dropdown.opened .cart-dropdown-close {
    display: flex;
}

.cart-dropdown-close:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.cart-dropdown-close:hover i {
    color: #fff;
}

.cart-dropdown-close i {
    font-size: 14px;
    color: #333;
}

/* Alert bar inside miniCart */
.cart-dropdown-alert {
    padding: 12px 16px;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.cart-dropdown-alert.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.cart-dropdown-alert.success {
    background: #4CAF50;
    color: #fff;
}

.cart-dropdown-alert.error {
    background: #f44336;
    color: #fff;
}

.cart-dropdown-alert.warning {
    background: #ff9800;
    color: #fff;
}

/* Slide in from top - for opened mode */
@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide out to top - for closing opened mode */
@keyframes slideOutToTop {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Slide in from right - for sticky mode (auto-show) */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile - sticky mode takes full width with padding */
@media (max-width: 767px) {
    .header-cart-dropdown.show.sticky-mode .cart-dropdown-menu,
    .header-cart-dropdown.opened .cart-dropdown-menu {
        left: 20px;
        right: 20px;
        top: 20px;
        width: auto;
        min-width: auto;
    }
}

/* Cart dropdown - wider for better UX */
.cart-dropdown-menu {
    min-width: 400px !important;
}

/* Cart dropdown items - no padding, images closer to edge */
.cart-dropdown-items {
    padding: 0;
}

/* Remove from cart button - subtle gray by default */
.remove-from-cart {
    color: #ccc8c8;
    transition: color 0.2s ease;
}

.remove-from-cart:hover {
    color: #dc3545;
}

/* Mini cart loading state - dropdown */
#miniCart.cart-loading .mini-cart-inner .cart-dropdown-items {
    opacity: 0.3;
    pointer-events: none;
}

#miniCart.cart-loading .mini-cart-inner .cart-dropdown-header::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #dc3545;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* Mini cart loading state - button (when counter is hidden) */
#miniCart.cart-loading .mini-cart-count.hidden {
    display: block !important;
    background: transparent;
    color: transparent;
}

#miniCart.cart-loading .mini-cart-count.hidden::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin-centered 0.8s linear infinite;
}

/* Spin animation for inline elements */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Spin animation for positioned elements (with translate) */
@keyframes spin-centered {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}


/* ========================================================================
   UNIVERSAL FORM UTILITIES
   Reusable form components for the entire SECO project

   USE THESE CLASSES:
   - .seco-input       → text inputs, email, tel, etc.
   - .seco-select      → select dropdowns
   - .seco-textarea    → textareas
   - .seco-form-group  → wrapper for label + input
   - .seco-form-row-2  → 2-column grid layout (responsive)

   EXAMPLE HTML:

   <div class="seco-form-row-2">
      <div class="seco-form-group">
         <label>Imię</label>
         <input type="text" class="seco-input" placeholder="Jan">
      </div>
      <div class="seco-form-group">
         <label>Nazwisko</label>
         <input type="text" class="seco-input" placeholder="Kowalski">
      </div>
   </div>

   ======================================================================== */

/* Base input styling */
.seco-input,
.seco-select,
.seco-textarea {
   padding: var(--space-md);
   background: var(--color-bg);
   border: 1px solid var(--color-border);
   border-radius: var(--radius-sm);
   font-family: var(--font-base);
   font-size: var(--fs-small);
   width: 100%;
   transition: border-color 0.2s ease;
}

/* Focus state */
.seco-input:focus,
.seco-select:focus,
.seco-textarea:focus {
   outline: none;
   border-color: var(--color-text);
}

/* Disabled state */
.seco-input:disabled,
.seco-select:disabled,
.seco-textarea:disabled {
   background: var(--color-bg-secondary);
   cursor: not-allowed;
   opacity: 0.6;
}

/* Form group (label + input wrapper) */
.seco-form-group {
   margin-bottom: var(--space-lg);
}

.seco-form-group label {
   display: block;
   margin-bottom: var(--space-xs);
   font-size: 0.8125rem;
   font-weight: var(--fw-medium);
   color: var(--color-text);
}

/* Form row - 2 column grid */
.seco-form-row-2 {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: var(--space-lg);
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
   .seco-form-row-2 {
      grid-template-columns: 1fr;
   }
}

/* ============================================
   B2C Header Profile Dropdown
   ============================================ */
.b2c-header__profile-dropdown {
  position: relative;
  display: inline-block;
}

.b2c-header__profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--color-bg-dark, #000000);
  color: var(--color-text-inverse, #ffffff);
  text-decoration: none;
  border-radius: var(--radius-pill, 999px);
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.2s;
}

.b2c-header__profile:hover {
  opacity: 0.9;
}

.b2c-header__profile strong {
  margin-left: 4px;
}

.b2c-header__profile i.fa-chevron-down {
  font-size: 12px;
  color: var(--color-text-inverse, #ffffff);
  transition: transform 0.2s;
}

.b2c-header__profile-dropdown:hover .b2c-header__profile i.fa-chevron-down {
  transform: rotate(180deg);
}

.b2c-header__profile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  margin-top: 8px;
}

.b2c-header__profile-dropdown:hover .b2c-header__profile-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #2c2c2c;
  text-decoration: none;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.profile-menu-item:last-child {
  border-bottom: none;
}

.profile-menu-item:hover {
  background-color: #f9f9f9;
}

.profile-menu-item i {
  width: 16px;
  text-align: center;
  color: #666;
}

.profile-menu-item--logout {
  color: #e34636;
}

.profile-menu-item--logout i {
  color: #e34636;
}

.profile-menu-item--logout:hover {
  background-color: #fff5f5;
}

/* Hide wishlist heart icon in header */
.b2c-header__icon-btn[aria-label="Ulubione"],
.b2c-mobile-header__icon[aria-label="Ulubione"] {
  display: none !important;
}

/* Mobile: disable dropdown, keep simple link */
@media (max-width: 768px) {
  .b2c-header__profile-menu {
    display: none;
  }

  .b2c-header__profile i.fa-chevron-down {
    display: none;
  }
}
