/* CloudUICart — Shopping Cart Styles
   Extends CloudUI's Tailwind-based design system */

/* ===== Break out of header.tpl main container for full-width cart pages ===== */
#main-content > .max-w-7xl {
    max-width: none;
    padding: 0;
}

/* ===== Server Table Responsive Toggle ===== */
.server-table-desktop { display: none; }
.server-table-mobile { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 1024px) {
    .server-table-desktop { display: block; }
    .server-table-mobile { display: none; }
}

/* ===== Server Mobile Specs Grid ===== */
.server-mobile-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
    margin-bottom: 0.75rem;
}
.server-mobile-specs > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

/* ===== Layout ===== */
.cart-wrapper {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 640px) { .cart-wrapper { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .cart-wrapper { padding: 0 2rem; } }

.cart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 1024px) {
    .cart-grid { grid-template-columns: 2fr 1fr; }
}

/* ===== Page Header ===== */
.cart-page-header {
    margin-bottom: 1.5rem;
}
.cart-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary, #0f172a);
}
.dark .cart-page-header h1 { color: #fff; }
.cart-page-header p {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}
.dark .cart-page-header p { color: #94a3b8; }

/* ===== Cart Items ===== */
.cart-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s;
}
.dark .cart-item { border-color: #334155; }
.cart-item:hover { background-color: #f8fafc; }
.dark .cart-item:hover { background-color: rgba(51, 65, 85, 0.3); }
.cart-item:last-child { border-bottom: none; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #0f172a;
}
.dark .cart-item-title { color: #f8fafc; }
.cart-item-group {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
}
.dark .cart-item-group { color: #94a3b8; }
.cart-item-domain {
    font-size: 0.75rem;
    color: #2563eb;
    font-family: ui-monospace, monospace;
    margin-top: 0.125rem;
}
.dark .cart-item-domain { color: #60a5fa; }
.cart-item-config {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.375rem;
    line-height: 1.5;
}
.dark .cart-item-config { color: #64748b; }

.cart-item-price {
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
}
.cart-item-price .amount {
    font-weight: 600;
    font-size: 0.875rem;
    font-family: ui-monospace, monospace;
    color: #0f172a;
}
.dark .cart-item-price .amount { color: #f8fafc; }
.cart-item-price .cycle {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
}
.dark .cart-item-price .cycle { color: #64748b; }
.cart-item-price .setup {
    display: block;
    font-size: 0.6875rem;
    color: #94a3b8;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.cart-item-actions a,
.cart-item-actions button {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.15s;
}
.cart-item-actions .btn-edit {
    color: #2563eb;
}
.cart-item-actions .btn-edit:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}
.dark .cart-item-actions .btn-edit:hover { background-color: rgba(37, 99, 235, 0.15); }
.cart-item-actions .btn-remove {
    color: #ef4444;
}
.cart-item-actions .btn-remove:hover {
    background-color: #fef2f2;
    color: #dc2626;
}
.dark .cart-item-actions .btn-remove:hover { background-color: rgba(239, 68, 68, 0.15); }

/* ===== Order Summary Sidebar ===== */
.order-summary {
    position: sticky;
    top: 5rem;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}
.summary-row .label-text { color: #64748b; }
.dark .summary-row .label-text { color: #94a3b8; }
.summary-row .value-text {
    font-family: ui-monospace, monospace;
    color: #0f172a;
    font-weight: 500;
}
.dark .summary-row .value-text { color: #f8fafc; }
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 2px solid #e2e8f0;
    font-weight: 700;
}
.dark .summary-total { border-color: #475569; }
.summary-total .label-text {
    font-size: 0.875rem;
    color: #0f172a;
}
.dark .summary-total .label-text { color: #fff; }
.summary-total .value-text {
    font-size: 1.25rem;
    font-family: ui-monospace, monospace;
    color: #2563eb;
}

/* ===== Promo Code ===== */
.promo-input-group {
    display: flex;
    gap: 0.5rem;
}
.promo-input-group input {
    flex: 1;
    min-width: 0;
}
.promo-input-group button {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ===== Billing Cycle Selector ===== */
.cycle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}
@media (min-width: 640px) {
    .cycle-grid { grid-template-columns: repeat(3, 1fr); }
}
.cycle-option {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    background: #fff;
}
.dark .cycle-option {
    border-color: #475569;
    background: #1e293b;
}
.cycle-option:hover {
    border-color: #93c5fd;
}
.cycle-option.selected {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 0 0 1px #2563eb;
}
.dark .cycle-option.selected {
    border-color: #60a5fa;
    background-color: rgba(37, 99, 235, 0.15);
}
.cycle-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.cycle-option .cycle-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.dark .cycle-option .cycle-name { color: #cbd5e1; }
.cycle-option .cycle-price {
    font-size: 1.125rem;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    color: #0f172a;
    margin-top: 0.25rem;
}
.dark .cycle-option .cycle-price { color: #f8fafc; }
.cycle-option.selected .cycle-name { color: #2563eb; }
.dark .cycle-option.selected .cycle-name { color: #60a5fa; }

/* ===== Config Options ===== */
.config-option-group {
    margin-bottom: 1.25rem;
}
.config-option-group .group-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}
.dark .config-option-group .group-label { color: #f8fafc; }

/* ===== Gateway Selection ===== */
.gateway-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}
@media (min-width: 640px) {
    .gateway-grid { grid-template-columns: repeat(3, 1fr); }
}
.gateway-option {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    background: #fff;
}
.dark .gateway-option {
    border-color: #475569;
    background: #1e293b;
}
.gateway-option:hover { border-color: #93c5fd; }
.gateway-option.selected {
    border-color: #2563eb;
    background: #eff6ff;
}
.dark .gateway-option.selected {
    border-color: #60a5fa;
    background: rgba(37, 99, 235, 0.15);
}
.gateway-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.gateway-option .gateway-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
}
.dark .gateway-option .gateway-name { color: #cbd5e1; }

/* ===== Addon Cards ===== */
.addon-card {
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.15s;
}
.dark .addon-card { border-color: #475569; }
.addon-card:hover { border-color: #93c5fd; }
.addon-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
}
.dark .addon-card.selected {
    border-color: #60a5fa;
    background: rgba(37, 99, 235, 0.15);
}

/* ===== Empty Cart ===== */
.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
}
.cart-empty svg {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: #cbd5e1;
}
.dark .cart-empty svg { color: #475569; }
.cart-empty h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
}
.dark .cart-empty h3 { color: #f8fafc; }
.cart-empty p {
    font-size: 0.875rem;
    color: #64748b;
}
.dark .cart-empty p { color: #94a3b8; }

/* ===== Responsive Helpers ===== */
@media (max-width: 639px) {
    .cart-item {
        flex-direction: column;
        gap: 0.75rem;
    }
    .cart-item-price {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    .cart-item-actions {
        align-self: flex-end;
    }
}

/* ===== Domain Search ===== */
.domain-search-wrap {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.domain-search-wrap input { flex: 1; }
@media (max-width: 639px) {
    .domain-search-wrap {
        flex-direction: column;
    }
}

/* ===== Print ===== */
@media print {
    .cart-item-actions,
    .promo-input-group,
    .btn-primary,
    .btn-remove { display: none !important; }
}
