/* Updated layout: single-column, body above image, buy button over image bottom-left */
.cptpl {
  --pl-gap: 1rem;
  --pl-border: #e5e7eb;
  --pl-radius: 10px;
  --pl-title: #111827;
  --pl-text: #374151;
  --pl-muted: #6b7280;
  --pl-price: #111827;
  --pl-btn-bg: #111827;
  --pl-btn-bg-hover: #000000;
  --pl-btn-text: #ffffff;
  margin: 1rem 0;
}

/* Force single-column layout */
.cptpl--grid {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: var(--pl-gap);
}

/* Individual item */
.cptpl__item {
  
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  position: relative; /* used for absolute-positioned actions */
}

/* We reorder visually: body above image */
.cptpl__body { order: 1; padding: 0.875rem; }
.cptpl__image { order: 2; display: block; background: #f9fafb; position: relative; }

/* Thumbnail styling: full width image */
.cptpl__thumb,
.cptpl__thumb img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Placeholder keeps aspect ratio */
.cptpl__thumb--placeholder { width: 100%; aspect-ratio: 4/3; background: #f3f4f6; display:block; }

/* Title / Description above image */
.cptpl__title { margin: 0 0 0.25rem; font-size:44px;line-height:46px; color: #232323; }
.cptpl__title a { color: inherit; text-decoration: none; }
.cptpl__title a:hover { text-decoration: underline; }
.cptpl__desc { color: var(--pl-text); font-size: .95rem; margin-bottom: 0.5rem; }

/* Meta row kept but reserve space at bottom so overlay doesn't hide text */
.cptpl__meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap:wrap; }

/* Price styling */
.cptpl__price { color: var(--pl-price); font-weight: 700; }


/* Button look */
.cptpl__actions {
    position: absolute;
    right: 32px;
    bottom: 32px;
    z-index: 5;
    display: flex;
    gap: 8px;
}

.cptpl__actions .cptpl__buy {
    color: #232323;
    font-weight: 600;
    cursor: pointer;
    font-size: 20px;
    line-height: 22px;
    text-transform: uppercase;
    position: relative; /* AGGIUNGI QUESTA RIGA */
    padding-right: 45px; /* Spazio per il check */
}

.cptpl__actions .cptpl__buy::after {
    content: "➔"; /* Freccia Unicode */
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    font-weight: 900;
    font-size: 18px; /* Leggermente più grande per la freccia */
    color: white;
    background: #00006A;
    border-radius: 9999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

/* Disabled button */
.cptpl__buy--disabled {
  background: #d1d5db !important;
  color: #6b7280 !important;
  cursor: not-allowed !important;
  box-shadow: none;
}

/* Notice & empty state */
.cptpl--empty { color: var(--pl-muted); font-style: italic; }
.cptpl-notice { border: 1px solid var(--pl-border); border-radius: 6px; padding: .75rem 1rem; margin-bottom: 1rem; }
.cptpl-notice--success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.cptpl-notice--error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

/* Responsive tweaks */
@media (min-width: 700px) {
  /* keep items visually compact on bigger screens but still single column */
  .cptpl__body { padding: 1rem; }
}

/* If grid classes with multiple columns are still output, ensure each item spans full width */
.cptpl--cols-2 .cptpl__item,
.cptpl--cols-3 .cptpl__item,
.cptpl--cols-4 .cptpl__item,
.cptpl--cols-5 .cptpl__item,
.cptpl--cols-6 .cptpl__item {
  grid-column: 1 / -1;
}

.cptpl__body{text-align:left}

/* Ensure the buy button doesn't cover the body text (image area reserved by item structure) */
/* Give the image area a min-height so the overlay is nicely placed regardless of image height */
/*.cptpl__image { min-height: 180px; }*/

/* Accessibility: make sure actions wrap on very narrow screens */
/*
@media (max-width:420px) {
  .cptpl__actions { left: 8px; bottom: 8px; }
  .cptpl__actions .cptpl__buy { padding: 0.4rem 0.6rem; font-size: 0.95rem; }
}
*/


@media (max-width:600px) {
	
	.cptpl__actions .cptpl__buy {
    
    font-size: 13px;
    line-height: 15px;
    padding-right: 20px; /* Spazio per il check */
	}
	
	.cptpl__title { margin: 0px; font-size:30px;line-height:35px; }
	
	
	
.cptpl__actions .cptpl__buy::after {

    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-weight: 800;
    font-size: 12px; 
}
.cptpl__actions{right: 14px; bottom: 14px;}
}


.cptpl-ordering {
    margin-bottom: 1.5rem;
    text-align: right;
}

.cptpl-ordering-form {
    display: inline-block;
}

.cptpl-orderby {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    background: #fff;
    color: #374151;
    cursor: pointer;
    min-width: 200px;
}

.cptpl-orderby:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

@media (max-width: 600px) {
    .cptpl-ordering {
        text-align: left;
    }
    
    .cptpl-orderby {
        width: 100%;
        min-width: auto;
    }
}