/* ===================================
   PP Tiered Stock Display - Modern Accordion Style
   Version 2.0 - Radical Redesign
   =================================== */

/* Container & Loading States */
#tiered-stock-container {
    margin: 0px;
    padding-bottom: 20px;}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Small inline spinner for badge loading state */
.pp-stock-spinner-inline {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.7;
}

/* Placeholder for variable products */
.pp-stock-var-placeholder {
    background: #f9f9f9;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #fe5000;
}

.pp-stock-var-placeholder p {
    padding: 0 !important;
    margin: 0 !important;
    color: #555;
    font-size: 14px;
}

/* ===================================
   ACCORDION WIDGET STRUCTURE
   =================================== */

.pp-stock-accordion-widget {
    
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); */
    border: 1px solid #ececec;
}

/* Accordion Section */
.pp-accordion-section {
    border-bottom: 1px solid #ececec;
}

.pp-accordion-section:last-child {
    border-bottom: none;
}

/* Accordion Header (Clickable) */
.pp-accordion-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.pp-accordion-header:hover {
    background-color: #f9f9f9;
    opacity: 0.95;
}

.pp-accordion-header.active {
    background-color: #f9f9f9;
}

/* Dynamic background color support - when inline style is applied */
.pp-accordion-header[style*=\"background-color\"]:hover {
    filter: brightness(0.98);
}

.pp-accordion-header[style*=\"background-color\"].active {
    /* Inline style will take precedence, this is just for specificity */
}

/* Icon container */
.pp-accordion-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    display:none;
}

.pp-accordion-icon svg {
    width: 40px;
    height: 40px;
    display: block;
}

/* Content wrapper */
.pp-accordion-content-wrapper {
    flex: 1;
    min-width: 0;
}

/* Title and summary */
.pp-accordion-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 5px;
    align-items: center;
}

.pp-accordion-title-text {
    font-size: 15px;
    font-weight: 600;
    color: #2a2a2a;
}

.pp-accordion-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px 4px 10px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pp-accordion-badge-text {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    font-style: italic;
}

.pp-accordion-summary {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}
.pp-accordion-summary a {
    color:#666;
    border-bottom:1px solid #EAEAEA;
}
.pp-accordion-summary .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    color:#c5c5c5;
}

/* Toggle arrow */
.pp-accordion-toggle {
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    transition: transform 0.3s ease;
}

.pp-accordion-header.active .pp-accordion-toggle {
    transform: rotate(180deg);
}

.pp-accordion-toggle svg {
    width: 16px;
    height: 16px;
}

/* Accordion Body (Expandable) */
.pp-accordion-body {
    display: none;
    overflow: hidden;
}

.pp-accordion-section.active .pp-accordion-body {
    display: block;
    padding: 10px 20px 12px 20px;
}

.pp-accordion-body-content {
    font-size: 12px;
    line-height: 1.6;
    color: #555;
}

.pp-accordion-body-content p {
    margin: 0 0 10px 0;
}

.pp-accordion-body-content p:last-child {
    margin-bottom: 0;
}

/* ===================================
   COLORS
   =================================== */

.stock-green, .pp-collection-available, .pp-fitting-available {
    background: #e8f5e9;
    color: #41b07c;
    border: 1px solid #41b07c59;
}

.stock-blue, .pp-fitting-badge, .pp-fitting-unavailable {
    background: #e3f2fd;
    color: #4c85c7;
    border: 1px solid #bbdefb;
}

.stock-orange {
    background: #fff3e0;
    color: #ff762c;
    border: 1px solid #ffe0b2;
}

.stock-red {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.stock-grey, .pp-collection-unavailable {
    background: #f5f5f5;
    color: #616161;
    border: 1px solid #e0e0e0;
}

.stock-gold, .pp-rewards-badge {
    background: #fffbee;
    color: #c9a238;
    border: 1px solid #f2e0a7;
}

/* ===================================
   DELIVERY SECTION SPECIFIC STYLES
   =================================== */

.pp-delivery-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Delivery ETA text */
.pp-delivery-eta {
    font-size: 13px;
    color: #666;
}

.pp-delivery-eta strong {
    color: #333;
    font-weight: 600;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media only screen and (max-width: 850px) {
    .pp-accordion-section.active .pp-accordion-body {
        padding: 10px 20px 12px 20px;
    }
}

@media only screen and (max-width: 600px) {
    .pp-accordion-header {
        padding: 14px 16px;
    }
    
    .pp-accordion-icon {
        width: 50px;
        height: 50px;
        min-width: 50px;
        margin-right: 10px;
    }
    
    .pp-accordion-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .pp-accordion-title-text {
        font-size: 14px;
    }
    
    .pp-accordion-summary {
        font-size: 12px;
    }
    
    .pp-accordion-section.active .pp-accordion-body {
        padding: 10px 20px 12px 20px;
        max-height: 600px;
    }
    
    .pp-accordion-body-content {
        font-size: 12px;
    }
}

/* ===================================
   UTILITY ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pp-stock-accordion-widget {
    animation: fadeIn 0.3s ease;
}

/* Pulse animation for in-stock indicator */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.stock-green .pp-accordion-badge {
    animation: pulse 2s ease-in-out infinite;
}

/* ===================================
   DASHICONS SUPPORT
   =================================== */

.pp-stock-info-blink {
    animation: pp-stock-info-blink 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    color: #fe5000 !important;
    border-radius: 50%;
    transition: opacity 0.3s;
    opacity: 0.85;
    margin-right: 7px;
    vertical-align: middle;
}

@keyframes pp-stock-info-blink {
    0% { opacity: 0.85; }
    50% { opacity: 0.35; }
    100% { opacity: 0.85; }
}

/* ===================================
   STAFF
   =================================== */

.staff-info-box {font-size:12px;}
.staff-info-box .sku-status-matched {
    color: #41b07c;
    font-weight: bold;
}
.staff-info-box .sku-status-not-matched {
    color: #f44336;
    font-weight: bold;
}
.staff-info-box .sku-status-not-required {
    color: #76bb6d;
    font-weight: bold;
}

/* ===================================
   LEGACY COMPATIBILITY
   =================================== */

.pp-stock-notification {
    display: none;
}

.pp-stock-notification a {
    text-decoration: underline;
}

/* Admin Styling */
.tab-content {
    margin-top: 20px;
    background: #fff;
    padding: 20px;
    border: 1px solid #ccc;
    border-top: none;
}

.mapping-placeholder {
    text-align: center;
    padding: 50px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    color: #777;
    font-style: italic;
}


/* Block Content */
.pp-stock-notification {margin: 10px 0px 10px 0px; box-sizing: border-box; align-items: center; padding: 0px 0px 2px 0px;}
.pp-stock-notification-l {width:35%;display: inline-block; box-sizing: border-box; text-align: center; padding:15px 15px 15px 15px;}
.pp-stock-notification-r {width:65%;display: inline-block; box-sizing: border-box; padding:0px 0px 0px 0px; color: #555555;}
.pp-stock-var-placeholder {background:#f9f9f9;padding: 10px 15px 10px 15px; border-radius: 12px;}
.pp-stock-var-placeholder p {padding:0px!important; margin:0px!important;}

.pp-stock-eta {color: #555555; font-size:12px; line-height: 1.2em;}
.pp-stock-eta span {font-weight: 700;}
.pp-stock-supply {font-size:13px; padding: 15px 15px 15px 15px;}
.pp-stock-mi {text-decoration: underline; font-size:80%; margin-left:5px; opacity:0.8;}

.bubble {position: relative; display: inline-block; border-radius: 8px; margin-bottom: 12px; width: auto; text-transform: uppercase; }
.bubble:after {content: '';position: absolute;bottom: 0;left: 50%;width: 0;height: 0;border: 7px solid transparent;border-bottom: 0;margin-left: -7px;margin-bottom: -7px;}

/* Attention Blocks */
/* GREEN */
.blk-green {background: #f0f9f5;}
.blk-green .bubble {background:#41b07c; color: #FFFFFF; font-size:13px; padding:6px 15px; text-align: center; font-family:'Poppins';}
.blk-green .bubble:after {border-top-color: #41b07c;}
.blk-green .pp-stock-supply {border-left: 1px solid #41b07c30;}
.blk-green .pp-stock-supply span {color: #41b07c; font-weight:700;}
.blk-green .pp-stock-collection {border-top: 1px solid #cfebde;}

/* BLUE */
.blk-blue {background: #eef6fa;}
.blk-blue .bubble {background:#4f8ae2; color: #FFFFFF; font-size:13px; padding:6px 15px; text-align: center; font-family:'Poppins';}
.blk-blue .bubble:after {border-top-color: #4f8ae2;}
.blk-blue .pp-stock-supply {border-left: 1px solid #4f8ae223;}
.blk-blue .pp-stock-supply span {color: #4f8ae2; font-weight:700;}
.blk-blue .pp-stock-collection {border-top: 1px solid #4f8ae223;}

/* ORANGE */
.blk-orange {background: #fff7f1;}
.blk-orange .bubble {background:#f28b3f; color: #FFFFFF; font-size:13px; padding:6px 15px; text-align: center; font-family:'Poppins';}
.blk-orange .bubble:after {border-top-color: #f28b3f;}
.blk-orange .pp-stock-supply {border-left: 1px solid #f28a3f25;}
.blk-orange .pp-stock-supply span {color: #f28b3f; font-weight:700;}
.blk-orange .pp-stock-collection {border-top: 1px solid #f28a3f25;}

/* RED */
.blk-red {background: #fff5f5;}
.blk-red .bubble {background:#ea5050; color: #FFFFFF; font-size:13px; padding:6px 15px; text-align: center; font-family:'Poppins';}
.blk-red .bubble:after {border-top-color: #ea5050;}
.blk-red .pp-stock-supply {border-left: 1px solid #ea50502d;}
.blk-red .pp-stock-supply span {color: #ea5050; font-weight:700;}
.blk-red .pp-stock-eta {color:#ea5050;}
.blk-red .pp-stock-collection {border-top: 1px solid #ea50502d;}

/* GREY */
.blk-grey {background: #f9f9f9;}
.blk-grey .bubble {background:#9c9c9c; color: #FFFFFF; font-size:13px; padding:6px 15px; text-align: center; font-family:'Poppins';}
.blk-grey .bubble:after {border-top-color: #9c9c9c;}
.blk-grey .pp-stock-supply {border-left: 1px solid #9c9c9c32;}
.blk-grey .pp-stock-supply span {color: #9c9c9c; font-weight:700;}
.blk-grey .pp-stock-collection {border-top: 1px solid #9c9c9c32;}


/* Dynamic */
.ssgroup {display: none;}

/* Loop */
.pp-stock-loop-notice {display: block; position: absolute; top: 0px; left: 0px; z-index:999; color:#32C864; font-size:80%; background: rgba(255,255,255,0.8); padding: 2px 10px; text-transform: uppercase;}

/* Pulse */
.ring-container { position: relative;display: inline-block;margin-right: 20px;}
.rc-circle { width: 0px;  height: 0px; background-color: #ffffff00; border-radius: 50%;}
.rc-ringring {border: 2px solid #70dba9;-webkit-border-radius: 30px; border-radius: 30px; height: 21px; width: 21px; position: absolute; left: -2px;top: -2px;-webkit-animation: pulsate 1s ease-out;animation: pulsate 1s ease-out;-webkit-animation-iteration-count: infinite;animation-iteration-count: infinite;opacity: 0.0; z-index: 1;}

@-webkit-keyframes pulsate {
    0% {-webkit-transform: scale(0.1, 0.1); opacity: 0.0;}
    50% {opacity: 1.0;}
    100% {-webkit-transform: scale(1.2, 1.2); opacity: 0.0;}
}
@keyframes pulsate {
  0% {-webkit-transform: scale(0.1, 0.1); opacity: 0.0;}
  50% {opacity: 1.0;}
  100% {-webkit-transform: scale(1.2, 1.2); opacity: 0.0;}
}

/* Mobile Tweaks */
@media only screen and (max-width: 1300px) {
  .pp-stock-notification-l {width:35%;}
  .pp-stock-notification-r {width:65%;}
}
@media only screen and (max-width: 1000px) {
  .pp-stock-notification-l {width:50%;}
  .pp-stock-notification-r {width:50%;}
}
@media only screen and (max-width: 850px) {
  .pp-stock-notification-l {width:40%;}
  .pp-stock-notification-r {width:60%;}
}
@media only screen and (max-width: 429px) {
  .pp-stock-notification-l {width:100%;}
  .pp-stock-notification-r {width:100%;}
  .bubble {padding:6px 10px!important; font-size:12px;}
  
  .pp-staff-row {
    margin-bottom: 3px;
  }
}

/* Admin Styling */
.tab-content {
    margin-top: 20px;
    background: #fff;
    padding: 20px;
    border: 1px solid #ccc;
    border-top: none;
}

.mapping-placeholder {
    text-align: center;
    padding: 50px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    color: #777;
    font-style: italic;
}

/* SKU match status indicators */
.sku-matched {
    color: #41b07c; 
    font-weight: bold;
}

.sku-notmatched {
    color: #ea5050; 
    font-weight: bold;
}

/* COLLECTION */
.pp-stock-collection {display: inline-block;margin-top: 8px; padding-top: 8px;}
.pp-stock-col-yes {color: #41b07c!important;}
.pp-stock-col-no {color: #5a5a5a!important;}

/* Info icon blink effect for Dashicons */
.pp-stock-info-blink {
  animation: pp-stock-info-blink 2.2s cubic-bezier(0.4,0,0.2,1) infinite;
  color: #FE5000 !important;
  border-radius: 50%;
  transition: opacity 0.3s;
  opacity: 0.85;
  margin-right: 7px;
  vertical-align: middle;
}
@keyframes pp-stock-info-blink {
  0% { opacity: 0.85; }
  50% { opacity: 0.35; }
  100% { opacity: 0.85; }
}

/* Shimmer loading effect for API calls */
.pp-stock-loading-shimmer {
    position: relative;
    overflow: hidden;
}

.pp-stock-loading-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Skeleton loading effect for text elements */
.pp-stock-loading-shimmer .pp-accordion-summary,
.pp-stock-loading-shimmer .pp-stock-badge,
.pp-stock-loading-shimmer .pp-accordion-icon {
    opacity: 0.7;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.4;
    }
}

/* ===================================
   DELIVERY COUNTDOWN TIMER
   =================================== */

.pp-delivery-countdown {
    color: #41b07c;
    white-space: nowrap;
}

/* ===================================
   DISABLED ACCORDION (COLLECTION UNAVAILABLE)
   =================================== */

.pp-accordion-disabled .pp-accordion-header {
    cursor: default !important;
}

.pp-accordion-disabled .pp-accordion-header:hover {
    background-color: transparent !important;
}

.pp-accordion-disabled .pp-accordion-header.pp-no-click {
    pointer-events: none;
}

/* ===================================
   COMPOSITE & BUNDLE COMPONENT DISPLAY
   =================================== */

.components-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.components-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    margin: 0px!important;
}

.components-list li:last-child {
    border-bottom: none;
}

.components-list .component-name {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    flex: 1;
    margin: 0px 10px;
}

.components-list .pp-accordion-badge {
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .components-list .component-name {
        font-size: 13px;
    }
}

/* Loading state for components */
.components-loading {
    text-align: center;
    padding: 20px;
    color: #888;
    font-style: italic;
}

.components-loading .loading-spinner {
    margin: 0 auto;
}

.pp-rewards-summary span {
    color: inherit!important;
    font-weight: normal!important;}

/* ===================================
   Fastest Delivery Indicator
   Baseline styles - Theme coordinates positioning
   =================================== */

.pp-fastest-delivery-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    color: #41b07c;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
}

/* Single product page - before H1 title */
.single-product .product-info.product-summary .pp-fastest-delivery-indicator {
    margin-bottom: 8px;
    justify-content: flex-start;
    font-size:12px;
}


.pp-fastest-delivery-indicator svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* Archive/loop pages - baseline only, theme handles positioning */
.pp-fastest-delivery-loop {
    font-size: 10px;
    min-height: 19px;
    box-sizing: border-box;
}

.pp-fastest-delivery-loop svg {
    width: 14px;
    height: 14px;
}

.pp-fastest-delivery-indicator span {
    font-weight: 500;
}



