/*
 * Package Purchase Card (Elementor tag "Package Purchase Card").
 * Colors use Twicely's palette (tailwind.config.js): primary #FBBD03 /
 * #E5A902, button text black, neutral grays. Buy Now reuses
 * .twicely-buy-now-btn from cart.css; the like button reuses
 * .twicely-package-like-btn-inline from packages-grid.css; the chat button
 * is rendered by the chat React app inside #twicely-chat-container.
 */

.twicely-pc {
    --twicely-pc-text: #1f2937;
    --twicely-pc-muted: #6b7280;
    --twicely-pc-border: #e5e7eb;
    --twicely-pc-accent: #fbbd03;
    --twicely-pc-accent-dark: #e5a902;
    --twicely-pc-accent-soft: #fff6d6;

    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
    width: 100%;
    padding: 24px;
    background: #ffffff;
    border: 1px solid var(--twicely-pc-border);
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    color: var(--twicely-pc-text);
    font-family: 'Recoleta', 'Recoleta Alt', sans-serif;
}

/* Top row: breadcrumb left, wishlist right */
.twicely-pc__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.twicely-pc__crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--twicely-pc-muted);
}

/* Main category color comes from packages-grid.css (.twicely-category-main.twicely-category-{slug});
   secondary category and separator are black, like the Category Display tag. */
.twicely-pc__crumbs a,
.twicely-pc__crumbs .twicely-category-main,
.twicely-pc__crumbs .twicely-category-secondary {
    font-weight: 500;
    text-decoration: none;
}

.twicely-pc__crumbs a:hover {
    text-decoration: underline;
}

.twicely-pc__crumbs .twicely-category-secondary,
.twicely-pc__crumb-sep {
    color: #000000;
}

.twicely-pc__top .twicely-package-like-btn-inline {
    flex-shrink: 0;
}

/* Title */
.twicely-pc__title {
    margin: 0;
    font-size: 35px;
    line-height: 1.2;
    font-weight: 700;
    color: #000000;
    overflow-wrap: anywhere;
}

/* Valid-until pill */
.twicely-pc__valid {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #f66669;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

.twicely-pc__valid-icon {
    flex-shrink: 0;
    color: #ffffff;
}

.twicely-pc__valid-icon path {
    stroke: #ffffff;
}

/* Price */
.twicely-pc__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
}

.twicely-pc__price-main {
    font-size: 40px;
    line-height: 1.1;
    font-weight: 700;
    color: #000000;
}

.twicely-pc__price-was {
    font-size: 16px;
    color: #9ca3af;
    text-decoration: line-through;
}

.twicely-pc__price-off {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--twicely-pc-accent);
    color: #000000;
    font-size: 12px;
    font-weight: 700;
}

/* Original value / credit left */
/* Soft rounded panel, two columns split by a vertical divider; label on top,
   amount below. Original value is struck through. */
.twicely-pc__values {
    display: flex;
    align-items: stretch;
    padding: 14px 20px;
    border-radius: 16px;
    background: var(--twicely-pc-accent-soft);
}

.twicely-pc__value {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
}

.twicely-pc__value + .twicely-pc__value {
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* "Original value" / "Credit left" labels — same color as the "Sold by" caption */
.twicely-pc__value-label {
    font-size: 13px;
    font-weight: 300;
    color: #afafaf;
}

.twicely-pc__value-amount {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: #000000;
}

.twicely-pc__value--original .twicely-pc__value-amount {
    color: var(--twicely-pc-muted);
    text-decoration: line-through;
}

/* Actions */
.twicely-pc__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.twicely-pc__buy {
    box-sizing: border-box;
    text-align: center;
}

/* Chat button (React) — full width, outline style: no background, #F66669
   border, text and icon. Scoped to the card so other chat buttons are
   unchanged; !important is needed to beat chat.css (border:none !important). */
.twicely-pc__chat,
.twicely-pc__chat .twicely-chat-button {
    width: 100%;
    box-sizing: border-box;
}

.twicely-pc__chat .twicely-chat-button {
    justify-content: center;
    background: transparent !important;
    border: 1px solid #f66669 !important;
    color: #f66669 !important;
}

.twicely-pc__chat .twicely-chat-button .twicely-chat-button-text {
    color: #f66669 !important;
    font-weight: 600;
}

.twicely-pc__chat .twicely-chat-button .twicely-chat-button-icon {
    color: #f66669 !important;
    stroke: #f66669 !important;
}

/* Seller row */
.twicely-pc__seller {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--twicely-pc-border);
}

.twicely-pc__avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px !important;
    border-radius: 50% !important; /* full radius; !important beats theme/Elementor img rules, same as .twicely-package-owner-avatar */
    object-fit: cover;
}

.twicely-pc__avatar--empty {
    display: inline-block;
    background: var(--twicely-pc-border);
}

.twicely-pc__seller-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.twicely-pc__seller-caption {
    font-size: 10px;
    font-weight: 300;
    color: #afafaf;
}

.twicely-pc__seller-name {
    font-size: 16px;
    font-weight: 700;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.twicely-pc__profile {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: #083fb9;
    text-decoration: none;
}

.twicely-pc__profile:hover {
    text-decoration: underline;
}

/*
 * Sticky: position:sticky can't work on the card itself (its parent, the
 * HTML widget wrapper, is exactly as tall as the card). Add this class to
 * the Elementor column/container that holds the card (Advanced > CSS
 * Classes). Needs no overflow:hidden on ancestors and the container's
 * parent row aligned to flex-start/stretch with a taller sibling column.
 * Override the offset with --twicely-sticky-top (e.g. below a sticky header).
 */
@media (min-width: 1025px) {
    .twicely-sticky-card {
        position: sticky;
        top: var(--twicely-sticky-top, 96px);
        align-self: flex-start;
    }
}

@media (max-width: 1024px) {
    .twicely-sticky-card {
        position: static;
    }
}

@media (max-width: 480px) {
    .twicely-pc {
        padding: 18px;
        border-radius: 20px;
    }

    .twicely-pc__title {
        font-size: 24px;
    }

    .twicely-pc__price-main {
        font-size: 32px;
    }
}
