/*!
Theme Name: Catering Deva
Theme URI: https://safebiz.ro
Template: kadence
Author: Safebiz Solutions
Author URI: https://safebiz.ro
Description: A child theme for the Kadence Theme.
Version: 1.0.0
License: GNU General Public License v3.0 (or later)
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: kadence-child
*/

/* Theme customization starts here
-------------------------------------------------------------- */

/* Mobile & Large Mobile: 1 per row - More specific selector */
@media screen and (max-width: 767px) {
    .entry-content .orderable-products-list--grid .orderable-products-list__item {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 0 24px !important;
    }
}

/* Tablet: 2 per row - Applies to BOTH Grid and Compact-Mobile layouts */
@media screen and (min-width: 768px) and (max-width: 1119px) {
    /* Grid layout - 2 columns */
    .entry-content .orderable-products-list--grid .orderable-products-list__item {
        width: 50% !important;
        padding: 0 12px !important;
        margin: 0 0 24px !important;
    }
    
    /* Fix hero image width for 2 columns */
    .entry-content .orderable-products-list--grid .orderable-product__hero {
        width: auto !important;
    }
    
    /* IMPORTANT: Force Compact-Mobile to become Grid layout on tablet */
    .entry-content .orderable-products-list--compact-mobile {
        display: flex !important;
        flex-wrap: wrap !important;
    }
    
    .entry-content .orderable-products-list--compact-mobile .orderable-products-list__item {
        width: 50% !important;
        padding: 0 12px !important;
        margin: 0 0 24px !important;
        border-bottom: none !important;
    }
    
    /* Reset compact-mobile horizontal layout to vertical cards */
    .entry-content .orderable-products-list--compact-mobile .orderable-product {
        display: block !important;
        flex-direction: column !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
        border-radius: 8px !important;
        padding: 1rem !important;
    }
    
    .entry-content .orderable-products-list--compact-mobile .orderable-product__hero {
        flex: none !important;
        max-width: none !important;
        width: 100% !important;
        margin-bottom: 0.75rem !important;
    }
    
    .entry-content .orderable-products-list--compact-mobile .orderable-product__image {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
    }
    
    .entry-content .orderable-products-list--compact-mobile .orderable-product__content-wrap {
        gap: 0.5rem;
    }
    
    .entry-content .orderable-products-list--compact-mobile .orderable-product__title {
        font-size: 1.1rem;
    }
    
    .entry-content .orderable-products-list--compact-mobile .orderable-product__description {
        -webkit-line-clamp: 3;
    }
}

/* Desktop: 4 per row - More specific selector */
@media screen and (min-width: 1120px) {
    .entry-content .orderable-products-list--grid .orderable-products-list__item {
        width: 25% !important;
        padding: 0 12px !important;
        margin: 0 0 24px !important;
    }
    
    /* Ensure hero image is auto width */
    .entry-content .orderable-products-list--grid .orderable-product__hero {
        width: auto !important;
    }
}


/* ============================================
   COMPACT-MOBILE LAYOUT - DOAR PE MOBILE (0-767px)
   Layout horizontal cu imagine mică pentru maximă densitate
   ============================================ */
@media (max-width: 767px) {
  /* Grid view păstrează comportamentul default Orderable (vertical cards) */
  
  /* Compact Mobile: layout horizontal cu imagine mică */
  .single-content .orderable-products-list--compact-mobile .orderable-products-list__item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eceff1;
  }

  /* Override Orderable's column layout with horizontal layout - DOAR pentru compact-mobile */
  .single-content .orderable-products-list--compact-mobile .orderable-product,
  .orderable-products-list--compact-mobile .orderable-products-list__item .orderable-product {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0.85rem;
    padding: 0;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Force mobile hero styles - DOAR pentru compact-mobile */
  .single-content .orderable-products-list--compact-mobile .orderable-product__hero,
  .single-content .orderable-products-list--compact-mobile .orderable-products-list__item .orderable-product__hero {
    flex: 0 0 6rem !important;
    width: 100% !important;
    min-width: 60px !important;
    max-width: 95px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
  }

  .single-content .orderable-products-list--compact-mobile .orderable-product__image {
    width: 6rem !important;
    height: 6rem !important;
    object-fit: cover;
    border-radius: 0.6rem;
    margin: 0;
  }

  .single-content .orderable-products-list--compact-mobile .orderable-product__content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0;
  }

  .single-content .orderable-products-list--compact-mobile .orderable-product__content {
    padding: 0;
    margin: 0;
  }

  .single-content .orderable-products-list--compact-mobile .orderable-product__title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.3;
    text-transform: none;
  }

  .single-content .orderable-products-list--compact-mobile .orderable-product__description {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #444;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }

  .single-content .orderable-products-list--compact-mobile .orderable-product__actions {
    margin-top: auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .single-content .orderable-products-list--compact-mobile .orderable-product__actions-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .single-content .orderable-products-list--compact-mobile .orderable-product__actions-price .amount {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    margin: 0;
  }

  /* Serving size / Gramaj styling - DOAR pentru compact-mobile */
  .single-content .orderable-products-list--compact-mobile .orderable-product__actions-price .orderable-product__serving-size {
    font-size: 0.8rem;
    line-height: 1.2;
    color: #888;
    font-weight: 400;
  }

  .single-content .orderable-products-list--compact-mobile .orderable-product__actions-button .orderable-button {
    height: 2.4rem;
    line-height: 2.1rem;
    padding: 0 0.9rem !important;
    border-radius: 1.2rem;
    font-size: 0.95rem;
  }

  .single-content .orderable-products-list--compact-mobile .orderable-product__actions-counter {
    top: -0.35rem;
    right: -0.25rem;
  }
}

/* Extra optimizare pentru mobile foarte mic - DOAR compact-mobile */
@media (max-width: 375px) {
  .single-content .entry-content-wrap {
    padding: 1rem!important;
  }
  
  .single-content .orderable-products-list--compact-mobile .orderable-product__hero {
    flex-basis: 5.5rem;
    max-width: 5.5rem;
  }
  
  .single-content .orderable-products-list--compact-mobile .orderable-product__image {
    width: 5.5rem !important;
    height: 5.5rem !important;
  }
  
  .single-content .orderable-products-list--compact-mobile .orderable-product__title {
    font-size: 1rem;
  }
  
  .single-content .orderable-products-list--compact-mobile .orderable-product__description {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
  }
  
  .single-content .orderable-products-list--compact-mobile .orderable-product__actions-price .amount {
    font-size: 0.95rem;
  }
  
  .single-content .orderable-products-list--compact-mobile .orderable-product__actions-price .orderable-product__serving-size {
    font-size: 0.75rem;
  }
  
  .single-content .orderable-products-list--compact-mobile .orderable-product__actions-button .orderable-button {
    height: 2.3rem;
    line-height: 2rem;
    padding: 0 0.85rem !important;
    font-size: 0.9rem;
  }
}

/* ============================================
   COMPACT-MOBILE DISPLAY TYPE - FALLBACK STYLES
   Stiluri de bază pentru compact-mobile (suprascrise de media queries)
   IMPORTANT: Compact-Mobile se folosește DOAR pe 0-767px!
   ============================================ */

/* Layout principal - horizontal cards */
.orderable-products-list--compact-mobile .orderable-products-list__item {
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eceff1;
}

.orderable-products-list--compact-mobile .orderable-products-list__item:last-child {
    border-bottom: none;
}

.orderable-products-list--compact-mobile .orderable-product {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

/* Hero image - compact */
.orderable-products-list--compact-mobile .orderable-product__hero {
    flex: 0 0 6rem;
    max-width: 6rem;
    border-radius: 8px;
    overflow: hidden;
}

.orderable-products-list--compact-mobile .orderable-product__image {
    width: 6rem;
    height: 6rem;
    object-fit: cover;
    border-radius: 8px;
}

/* Content wrapper */
.orderable-products-list--compact-mobile .orderable-product__content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0; /* Fix pentru text overflow */
}

/* Title */
.orderable-products-list--compact-mobile .orderable-product__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

/* Description - max 2 lines */
.orderable-products-list--compact-mobile .orderable-product__description {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* Actions (price + button) */
.orderable-products-list--compact-mobile .orderable-product__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

/* Price section with serving size */
.orderable-products-list--compact-mobile .orderable-product__actions-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}

.orderable-products-list--compact-mobile .orderable-product__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
}

.orderable-products-list--compact-mobile .orderable-product__serving-size {
    font-size: 0.8rem;
    color: #888;
    font-weight: 400;
}

/* Button - compact version */
.orderable-products-list--compact-mobile .orderable-product__actions-button {
    flex-shrink: 0;
}

.orderable-products-list--compact-mobile .orderable-product__actions-button .orderable-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Extra small mobile adjustments - DOAR compact-mobile */
@media screen and (max-width: 374px) {
    .orderable-products-list--compact-mobile .orderable-product__hero {
        flex: 0 0 5rem;
        max-width: 5rem;
    }
    
    .orderable-products-list--compact-mobile .orderable-product__image {
        width: 5rem;
        height: 5rem;
    }
    
    .orderable-products-list--compact-mobile .orderable-product__title {
        font-size: 0.95rem;
    }
    
    .orderable-products-list--compact-mobile .orderable-product__description {
        font-size: 0.85rem;
    }
    
    .orderable-products-list--compact-mobile .orderable-product__price {
        font-size: 1rem;
    }
    
    .orderable-products-list--compact-mobile .orderable-product__serving-size {
        font-size: 0.75rem;
    }
    
    .orderable-products-list--compact-mobile .orderable-product__actions-button .orderable-button {
        padding: 0.45rem 0.85rem;
        font-size: 0.85rem;
    }
}

/* Compact-Mobile este folosit DOAR pe mobile (0-539px)
   Pe tablet și desktop se folosește Grid Layout cu 2/4 coloane */

/* Hide sticky cart when empty */
body.cart-is-empty .bottom-cart {
    display: none !important;
}

/* Show sticky cart when has items (mobile & tablet only) */
@media (max-width: 1024px) {
    body.cart-has-items .bottom-cart {
        display: flex !important;
    }
}

@media (max-width: 1024px) {
    .orderable-floating-cart {
        display: none !important;
    }
}


/* ================================================ */
/* STICKY CART INFO - ICON + TOTAL (MOBILE & TABLET) */
/* ================================================ */

.sticky-cart-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: all 0.2s ease;
}

.sticky-cart-wrapper:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

/* Cart Icon */
.sticky-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #ffffff;
}

.sticky-cart-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.sticky-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Hide badge when count is 0 */
.sticky-cart-count:empty,
body.cart-is-empty .sticky-cart-count {
    display: none;
}

/* Cart Info (Total) */
.sticky-cart-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    color: #ffffff;
}

.sticky-cart-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.sticky-cart-total {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

/* Hide on desktop */
@media (min-width: 1025px) {
    .sticky-cart-wrapper {
        display: none !important;
    }
}

/* Responsive adjustments */
@media (max-width: 374px) {
    .sticky-cart-wrapper {
        gap: 8px;
        padding: 6px 10px;
    }
    
    .sticky-cart-icon {
        width: 36px;
        height: 36px;
    }
    
    .sticky-cart-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .sticky-cart-label {
        font-size: 10px;
    }
    
    .sticky-cart-total {
        font-size: 14px;
    }
}